Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.7% → 90.1%
Time: 19.6s
Alternatives: 20
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 79.7% 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: 90.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 92.7%

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

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

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

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

    if -4.9999999999999998e-241 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-214

    1. Initial program 9.6%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    4. Simplified91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 92.7%

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

    if -4.9999999999999998e-241 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.9999999999999998e-214

    1. Initial program 9.6%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    4. Simplified91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - \frac{t - x}{\frac{z}{y - a}}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{if}\;a \leq -5.4 \cdot 10^{+134}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -280:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.75 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (/ (- t x) (/ z (- y a)))))
        (t_2 (+ x (* (- y z) (/ (- t x) a)))))
   (if (<= a -5.4e+134)
     t_2
     (if (<= a -280.0)
       t_1
       (if (<= a -2.75e-30)
         (+ x (/ y (/ a (- t x))))
         (if (<= a 8.5e-110)
           t_1
           (if (<= a 3e+54) (/ t (/ (- a z) (- y z))) t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - ((t - x) / (z / (y - a)));
	double t_2 = x + ((y - z) * ((t - x) / a));
	double tmp;
	if (a <= -5.4e+134) {
		tmp = t_2;
	} else if (a <= -280.0) {
		tmp = t_1;
	} else if (a <= -2.75e-30) {
		tmp = x + (y / (a / (t - x)));
	} else if (a <= 8.5e-110) {
		tmp = t_1;
	} else if (a <= 3e+54) {
		tmp = t / ((a - z) / (y - z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t - ((t - x) / (z / (y - a)))
    t_2 = x + ((y - z) * ((t - x) / a))
    if (a <= (-5.4d+134)) then
        tmp = t_2
    else if (a <= (-280.0d0)) then
        tmp = t_1
    else if (a <= (-2.75d-30)) then
        tmp = x + (y / (a / (t - x)))
    else if (a <= 8.5d-110) then
        tmp = t_1
    else if (a <= 3d+54) then
        tmp = t / ((a - z) / (y - z))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t - ((t - x) / (z / (y - a)));
	double t_2 = x + ((y - z) * ((t - x) / a));
	double tmp;
	if (a <= -5.4e+134) {
		tmp = t_2;
	} else if (a <= -280.0) {
		tmp = t_1;
	} else if (a <= -2.75e-30) {
		tmp = x + (y / (a / (t - x)));
	} else if (a <= 8.5e-110) {
		tmp = t_1;
	} else if (a <= 3e+54) {
		tmp = t / ((a - z) / (y - z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - ((t - x) / (z / (y - a)))
	t_2 = x + ((y - z) * ((t - x) / a))
	tmp = 0
	if a <= -5.4e+134:
		tmp = t_2
	elif a <= -280.0:
		tmp = t_1
	elif a <= -2.75e-30:
		tmp = x + (y / (a / (t - x)))
	elif a <= 8.5e-110:
		tmp = t_1
	elif a <= 3e+54:
		tmp = t / ((a - z) / (y - z))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(Float64(t - x) / Float64(z / Float64(y - a))))
	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / a)))
	tmp = 0.0
	if (a <= -5.4e+134)
		tmp = t_2;
	elseif (a <= -280.0)
		tmp = t_1;
	elseif (a <= -2.75e-30)
		tmp = Float64(x + Float64(y / Float64(a / Float64(t - x))));
	elseif (a <= 8.5e-110)
		tmp = t_1;
	elseif (a <= 3e+54)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - ((t - x) / (z / (y - a)));
	t_2 = x + ((y - z) * ((t - x) / a));
	tmp = 0.0;
	if (a <= -5.4e+134)
		tmp = t_2;
	elseif (a <= -280.0)
		tmp = t_1;
	elseif (a <= -2.75e-30)
		tmp = x + (y / (a / (t - x)));
	elseif (a <= 8.5e-110)
		tmp = t_1;
	elseif (a <= 3e+54)
		tmp = t / ((a - z) / (y - z));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(t - x), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.4e+134], t$95$2, If[LessEqual[a, -280.0], t$95$1, If[LessEqual[a, -2.75e-30], N[(x + N[(y / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e-110], t$95$1, If[LessEqual[a, 3e+54], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - \frac{t - x}{\frac{z}{y - a}}\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a}\\
\mathbf{if}\;a \leq -5.4 \cdot 10^{+134}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq -280:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -2.75 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-110}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.4e134 or 2.9999999999999999e54 < a

    1. Initial program 89.5%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
      2. associate-/r/80.4%

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

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

    if -5.4e134 < a < -280 or -2.74999999999999988e-30 < a < 8.50000000000000029e-110

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    4. Simplified80.0%

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

    if -280 < a < -2.74999999999999988e-30

    1. Initial program 99.8%

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

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

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

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

    if 8.50000000000000029e-110 < a < 2.9999999999999999e54

    1. Initial program 84.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{+134}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -280:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq -2.75 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-110}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \end{array} \]

Alternative 4: 70.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \left(t - x\right) \cdot \frac{z}{a - z}\\ \mathbf{if}\;a \leq -1.15 \cdot 10^{+136}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -2800:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;a \leq 1.32 \cdot 10^{-106}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* (- t x) (/ z (- a z))))))
   (if (<= a -1.15e+136)
     (+ x (* (- y z) (/ (- t x) a)))
     (if (<= a -2800.0)
       t_1
       (if (<= a -2.85e-30)
         (+ x (/ y (/ a (- t x))))
         (if (<= a 1.32e-106)
           (- t (/ (- t x) (/ z (- y a))))
           (if (<= a 5.5e+54) (/ t (/ (- a z) (- y z))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((t - x) * (z / (a - z)));
	double tmp;
	if (a <= -1.15e+136) {
		tmp = x + ((y - z) * ((t - x) / a));
	} else if (a <= -2800.0) {
		tmp = t_1;
	} else if (a <= -2.85e-30) {
		tmp = x + (y / (a / (t - x)));
	} else if (a <= 1.32e-106) {
		tmp = t - ((t - x) / (z / (y - a)));
	} else if (a <= 5.5e+54) {
		tmp = t / ((a - z) / (y - 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 - x) * (z / (a - z)))
    if (a <= (-1.15d+136)) then
        tmp = x + ((y - z) * ((t - x) / a))
    else if (a <= (-2800.0d0)) then
        tmp = t_1
    else if (a <= (-2.85d-30)) then
        tmp = x + (y / (a / (t - x)))
    else if (a <= 1.32d-106) then
        tmp = t - ((t - x) / (z / (y - a)))
    else if (a <= 5.5d+54) then
        tmp = t / ((a - z) / (y - 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 - x) * (z / (a - z)));
	double tmp;
	if (a <= -1.15e+136) {
		tmp = x + ((y - z) * ((t - x) / a));
	} else if (a <= -2800.0) {
		tmp = t_1;
	} else if (a <= -2.85e-30) {
		tmp = x + (y / (a / (t - x)));
	} else if (a <= 1.32e-106) {
		tmp = t - ((t - x) / (z / (y - a)));
	} else if (a <= 5.5e+54) {
		tmp = t / ((a - z) / (y - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((t - x) * (z / (a - z)))
	tmp = 0
	if a <= -1.15e+136:
		tmp = x + ((y - z) * ((t - x) / a))
	elif a <= -2800.0:
		tmp = t_1
	elif a <= -2.85e-30:
		tmp = x + (y / (a / (t - x)))
	elif a <= 1.32e-106:
		tmp = t - ((t - x) / (z / (y - a)))
	elif a <= 5.5e+54:
		tmp = t / ((a - z) / (y - z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(t - x) * Float64(z / Float64(a - z))))
	tmp = 0.0
	if (a <= -1.15e+136)
		tmp = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / a)));
	elseif (a <= -2800.0)
		tmp = t_1;
	elseif (a <= -2.85e-30)
		tmp = Float64(x + Float64(y / Float64(a / Float64(t - x))));
	elseif (a <= 1.32e-106)
		tmp = Float64(t - Float64(Float64(t - x) / Float64(z / Float64(y - a))));
	elseif (a <= 5.5e+54)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - ((t - x) * (z / (a - z)));
	tmp = 0.0;
	if (a <= -1.15e+136)
		tmp = x + ((y - z) * ((t - x) / a));
	elseif (a <= -2800.0)
		tmp = t_1;
	elseif (a <= -2.85e-30)
		tmp = x + (y / (a / (t - x)));
	elseif (a <= 1.32e-106)
		tmp = t - ((t - x) / (z / (y - a)));
	elseif (a <= 5.5e+54)
		tmp = t / ((a - z) / (y - z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(t - x), $MachinePrecision] * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.15e+136], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2800.0], t$95$1, If[LessEqual[a, -2.85e-30], N[(x + N[(y / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.32e-106], N[(t - N[(N[(t - x), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e+54], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2800:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -2.85 \cdot 10^{-30}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\

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

\mathbf{elif}\;a \leq 5.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.15e136

    1. Initial program 91.9%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
      2. associate-/r/81.8%

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

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

    if -1.15e136 < a < -2800 or 5.50000000000000026e54 < a

    1. Initial program 82.3%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z}{\frac{a - z}{t - x}}} \]
      4. associate-/r/77.7%

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

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

    if -2800 < a < -2.84999999999999989e-30

    1. Initial program 99.8%

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

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

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

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

    if -2.84999999999999989e-30 < a < 1.32000000000000001e-106

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    4. Simplified84.2%

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

    if 1.32000000000000001e-106 < a < 5.50000000000000026e54

    1. Initial program 84.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+136}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -2800:\\ \;\;\;\;x - \left(t - x\right) \cdot \frac{z}{a - z}\\ \mathbf{elif}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;a \leq 1.32 \cdot 10^{-106}:\\ \;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x - \left(t - x\right) \cdot \frac{z}{a - z}\\ \end{array} \]

Alternative 5: 58.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+231}:\\
\;\;\;\;\frac{-t}{\frac{a}{z} + -1}\\

\mathbf{elif}\;z \leq -2 \cdot 10^{-8}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+99}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 51.3%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
      3. distribute-neg-frac82.7%

        \[\leadsto \color{blue}{\frac{-t}{\frac{a - z}{z}}} \]
      4. div-sub82.8%

        \[\leadsto \frac{-t}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      5. sub-neg82.8%

        \[\leadsto \frac{-t}{\color{blue}{\frac{a}{z} + \left(-\frac{z}{z}\right)}} \]
      6. *-inverses82.8%

        \[\leadsto \frac{-t}{\frac{a}{z} + \left(-\color{blue}{1}\right)} \]
      7. metadata-eval82.8%

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

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

    if -3.5999999999999999e231 < z < -2e-8 or 5.49999999999999983e-46 < z < 1.69999999999999992e99

    1. Initial program 84.6%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
      2. associate-/r/61.5%

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

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

    if -2e-8 < z < 5.49999999999999983e-46

    1. Initial program 90.7%

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

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

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

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

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

    if 1.69999999999999992e99 < z

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
    4. Simplified77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{a}{\frac{z}{x}}} \]
    10. Simplified64.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+231}:\\ \;\;\;\;\frac{-t}{\frac{a}{z} + -1}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-8}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-46}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+99}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{a}{\frac{z}{x}}\\ \end{array} \]

Alternative 6: 72.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.16 \cdot 10^{-119}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \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)))))
   (if (<= a -2.85e-30)
     t_1
     (if (<= a 2.16e-119)
       (+ t (/ (- x t) (/ z y)))
       (if (<= a 3.3e+54) (/ t (/ (- a z) (- y z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / a));
	double tmp;
	if (a <= -2.85e-30) {
		tmp = t_1;
	} else if (a <= 2.16e-119) {
		tmp = t + ((x - t) / (z / y));
	} else if (a <= 3.3e+54) {
		tmp = t / ((a - z) / (y - 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 + ((y - z) * ((t - x) / a))
    if (a <= (-2.85d-30)) then
        tmp = t_1
    else if (a <= 2.16d-119) then
        tmp = t + ((x - t) / (z / y))
    else if (a <= 3.3d+54) then
        tmp = t / ((a - z) / (y - 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 + ((y - z) * ((t - x) / a));
	double tmp;
	if (a <= -2.85e-30) {
		tmp = t_1;
	} else if (a <= 2.16e-119) {
		tmp = t + ((x - t) / (z / y));
	} else if (a <= 3.3e+54) {
		tmp = t / ((a - z) / (y - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / a))
	tmp = 0
	if a <= -2.85e-30:
		tmp = t_1
	elif a <= 2.16e-119:
		tmp = t + ((x - t) / (z / y))
	elif a <= 3.3e+54:
		tmp = t / ((a - z) / (y - z))
	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) / a)))
	tmp = 0.0
	if (a <= -2.85e-30)
		tmp = t_1;
	elseif (a <= 2.16e-119)
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / y)));
	elseif (a <= 3.3e+54)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	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));
	tmp = 0.0;
	if (a <= -2.85e-30)
		tmp = t_1;
	elseif (a <= 2.16e-119)
		tmp = t + ((x - t) / (z / y));
	elseif (a <= 3.3e+54)
		tmp = t / ((a - z) / (y - z));
	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] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.85e-30], t$95$1, If[LessEqual[a, 2.16e-119], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+54], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq 3.3 \cdot 10^{+54}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.84999999999999989e-30 or 3.3e54 < a

    1. Initial program 86.4%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
      2. associate-/r/72.4%

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

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

    if -2.84999999999999989e-30 < a < 2.1599999999999999e-119

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1599999999999999e-119 < a < 3.3e54

    1. Initial program 82.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq 2.16 \cdot 10^{-119}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+54}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a}\\ \end{array} \]

Alternative 7: 37.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ \mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.8 \cdot 10^{-99}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-173}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-239}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-266}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))))
   (if (<= a -2.85e-30)
     x
     (if (<= a -1.8e-99)
       t
       (if (<= a -4.5e-173)
         t_1
         (if (<= a -1.85e-239)
           t
           (if (<= a 1.55e-266) t_1 (if (<= a 4e+54) t x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double tmp;
	if (a <= -2.85e-30) {
		tmp = x;
	} else if (a <= -1.8e-99) {
		tmp = t;
	} else if (a <= -4.5e-173) {
		tmp = t_1;
	} else if (a <= -1.85e-239) {
		tmp = t;
	} else if (a <= 1.55e-266) {
		tmp = t_1;
	} else if (a <= 4e+54) {
		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) :: t_1
    real(8) :: tmp
    t_1 = x * (y / z)
    if (a <= (-2.85d-30)) then
        tmp = x
    else if (a <= (-1.8d-99)) then
        tmp = t
    else if (a <= (-4.5d-173)) then
        tmp = t_1
    else if (a <= (-1.85d-239)) then
        tmp = t
    else if (a <= 1.55d-266) then
        tmp = t_1
    else if (a <= 4d+54) 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 t_1 = x * (y / z);
	double tmp;
	if (a <= -2.85e-30) {
		tmp = x;
	} else if (a <= -1.8e-99) {
		tmp = t;
	} else if (a <= -4.5e-173) {
		tmp = t_1;
	} else if (a <= -1.85e-239) {
		tmp = t;
	} else if (a <= 1.55e-266) {
		tmp = t_1;
	} else if (a <= 4e+54) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	tmp = 0
	if a <= -2.85e-30:
		tmp = x
	elif a <= -1.8e-99:
		tmp = t
	elif a <= -4.5e-173:
		tmp = t_1
	elif a <= -1.85e-239:
		tmp = t
	elif a <= 1.55e-266:
		tmp = t_1
	elif a <= 4e+54:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	tmp = 0.0
	if (a <= -2.85e-30)
		tmp = x;
	elseif (a <= -1.8e-99)
		tmp = t;
	elseif (a <= -4.5e-173)
		tmp = t_1;
	elseif (a <= -1.85e-239)
		tmp = t;
	elseif (a <= 1.55e-266)
		tmp = t_1;
	elseif (a <= 4e+54)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	tmp = 0.0;
	if (a <= -2.85e-30)
		tmp = x;
	elseif (a <= -1.8e-99)
		tmp = t;
	elseif (a <= -4.5e-173)
		tmp = t_1;
	elseif (a <= -1.85e-239)
		tmp = t;
	elseif (a <= 1.55e-266)
		tmp = t_1;
	elseif (a <= 4e+54)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.85e-30], x, If[LessEqual[a, -1.8e-99], t, If[LessEqual[a, -4.5e-173], t$95$1, If[LessEqual[a, -1.85e-239], t, If[LessEqual[a, 1.55e-266], t$95$1, If[LessEqual[a, 4e+54], t, x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -1.8 \cdot 10^{-99}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq -4.5 \cdot 10^{-173}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -1.85 \cdot 10^{-239}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-266}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4 \cdot 10^{+54}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.84999999999999989e-30 or 4.0000000000000003e54 < a

    1. Initial program 86.4%

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

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

    if -2.84999999999999989e-30 < a < -1.8e-99 or -4.50000000000000018e-173 < a < -1.85000000000000008e-239 or 1.54999999999999998e-266 < a < 4.0000000000000003e54

    1. Initial program 75.3%

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

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

    if -1.8e-99 < a < -4.50000000000000018e-173 or -1.85000000000000008e-239 < a < 1.54999999999999998e-266

    1. Initial program 77.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.8 \cdot 10^{-99}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-173}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-239}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-266}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 54.4% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq 2.85 \cdot 10^{-39}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2000000000000001e-7 or 1.05e47 < z

    1. Initial program 71.5%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y - z}}} \]
      3. distribute-neg-frac59.4%

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

      \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y - z}}} \]
    8. Taylor expanded in z around 0 54.9%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot y}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg54.9%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot y}{z}} \]
      3. associate-*l/59.4%

        \[\leadsto t - \color{blue}{\frac{t}{z} \cdot y} \]
      4. *-commutative59.4%

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

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

    if -3.2000000000000001e-7 < z < 2.8499999999999998e-39 or 1.0999999999999999e27 < z < 1.05e47

    1. Initial program 90.2%

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

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

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

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

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

    if 2.8499999999999998e-39 < z < 1.0999999999999999e27

    1. Initial program 89.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num67.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-7}:\\ \;\;\;\;t - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t}{z}\\ \end{array} \]

Alternative 9: 54.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-6}:\\
\;\;\;\;t - y \cdot \frac{t}{z}\\

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

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.5000000000000002e-6

    1. Initial program 73.7%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y - z}}} \]
      3. distribute-neg-frac60.8%

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

      \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y - z}}} \]
    8. Taylor expanded in z around 0 54.5%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{t \cdot y}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg54.5%

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

        \[\leadsto \color{blue}{t - \frac{t \cdot y}{z}} \]
      3. associate-*l/60.8%

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

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

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

    if -2.5000000000000002e-6 < z < 2.8499999999999998e-39

    1. Initial program 89.9%

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

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

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

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

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

    if 2.8499999999999998e-39 < z < 4.4999999999999999e27

    1. Initial program 89.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num67.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

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

    if 4.4999999999999999e27 < z < 2.5e51

    1. Initial program 85.9%

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

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

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

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

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

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

    if 2.5e51 < z

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{a}{\frac{z}{x}}} \]
    10. Simplified59.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{-6}:\\ \;\;\;\;t - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{a}{\frac{z}{x}}\\ \end{array} \]

Alternative 10: 54.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-7}:\\
\;\;\;\;t \cdot \frac{z - y}{z}\\

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

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

\mathbf{elif}\;z \leq 9.8 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.99999999999999977e-7

    1. Initial program 73.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/70.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num70.3%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr70.3%

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

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

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

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

    if -4.99999999999999977e-7 < z < 2.3500000000000001e-39

    1. Initial program 89.9%

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

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

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

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

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

    if 2.3500000000000001e-39 < z < 2.1999999999999999e27

    1. Initial program 89.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num67.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

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

    if 2.1999999999999999e27 < z < 9.79999999999999967e51

    1. Initial program 85.9%

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

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

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

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

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

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

    if 9.79999999999999967e51 < z

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{a}{\frac{z}{x}}} \]
    10. Simplified59.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{a}{\frac{z}{x}}\\ \end{array} \]

Alternative 11: 50.2% accurate, 1.0× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.74999999999999997e-6 or 2.5e51 < z

    1. Initial program 71.6%

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

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

    if -1.74999999999999997e-6 < z < 2.8499999999999998e-39

    1. Initial program 89.9%

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

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

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

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

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

    if 2.8499999999999998e-39 < z < 1.6499999999999999e27

    1. Initial program 89.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num67.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num67.6%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr67.6%

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

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

    if 1.6499999999999999e27 < z < 2.5e51

    1. Initial program 85.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-6}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+27}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 60.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-8} \lor \neg \left(z \leq 5.5 \cdot 10^{-46}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.2000000000000002e-8 or 5.49999999999999983e-46 < z

    1. Initial program 73.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num65.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/66.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num66.1%

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

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

    if -5.2000000000000002e-8 < z < 5.49999999999999983e-46

    1. Initial program 90.7%

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

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

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

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

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

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

Alternative 13: 67.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-7} \lor \neg \left(z \leq 5.5 \cdot 10^{-46}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.14999999999999997e-7 or 5.49999999999999983e-46 < z

    1. Initial program 73.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num65.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/66.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num66.1%

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

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

    if -1.14999999999999997e-7 < z < 5.49999999999999983e-46

    1. Initial program 90.7%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/79.8%

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

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

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

Alternative 14: 69.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-7}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.99999999999999977e-7

    1. Initial program 73.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/70.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num70.3%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr70.3%

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

    if -4.99999999999999977e-7 < z < 2.0999999999999999e-14

    1. Initial program 88.9%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/78.0%

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

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

    if 2.0999999999999999e-14 < z

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-7}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-14}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x}{z} \cdot \left(y - a\right)\\ \end{array} \]

Alternative 15: 69.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-6}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.74999999999999997e-6

    1. Initial program 73.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/70.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num70.3%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr70.3%

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

    if -1.74999999999999997e-6 < z < 4.1999999999999998e-14

    1. Initial program 88.9%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/78.0%

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

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

    if 4.1999999999999998e-14 < z

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-6}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{x}{\frac{z}{a - y}}\\ \end{array} \]

Alternative 16: 69.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-6}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.74999999999999997e-6

    1. Initial program 73.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/70.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num70.3%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr70.3%

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

    if -1.74999999999999997e-6 < z < 1.36e-14

    1. Initial program 88.9%

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      2. associate-/r/78.0%

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

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

    if 1.36e-14 < z

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y}}} \]
    7. Simplified65.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-6}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-14}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y}}\\ \end{array} \]

Alternative 17: 49.3% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.7000000000000003e62 or 3.59999999999999998e37 < z

    1. Initial program 68.5%

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

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

    if -4.7000000000000003e62 < z < 3.59999999999999998e37

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{+62}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+37}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 18: 56.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-8}:\\
\;\;\;\;t \cdot \frac{z - y}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.99999999999999973e-8

    1. Initial program 73.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. clear-num70.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a - z}{y - z}}{t}}} \]
      2. associate-/r/70.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num70.3%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr70.3%

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

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

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

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

    if -2.99999999999999973e-8 < z < 2.09999999999999981e-15

    1. Initial program 88.8%

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

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

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

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

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

    if 2.09999999999999981e-15 < z

    1. Initial program 75.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 58.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}} \]
    3. Step-by-step derivation
      1. associate--l+58.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--58.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-sub58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    9. Step-by-step derivation
      1. *-commutative54.7%

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

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

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

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

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

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

Alternative 19: 38.2% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+54}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.84999999999999989e-30 or 2.8999999999999999e54 < a

    1. Initial program 86.4%

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

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

    if -2.84999999999999989e-30 < a < 2.8999999999999999e54

    1. Initial program 75.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.85 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 20: 25.0% accurate, 13.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification29.2%

    \[\leadsto t \]

Reproduce

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