Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.2% → 93.4%
Time: 22.6s
Alternatives: 21
Speedup: 0.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 80.2% accurate, 1.0× speedup?

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

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

Alternative 1: 93.4% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \sqrt[3]{a - z}\\ t_2 := \frac{t - x}{a - z}\\ t_3 := x + \left(y - z\right) \cdot t_2\\ t_4 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;x + \frac{\frac{\left(y - z\right) \cdot \left(t - x\right)}{{t_1}^{2}}}{t_1}\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_4 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-254}:\\ \;\;\;\;t_4 + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, t_2, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (cbrt (- a z)))
        (t_2 (/ (- t x) (- a z)))
        (t_3 (+ x (* (- y z) t_2)))
        (t_4 (* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z))))))
   (if (<= t_3 (- INFINITY))
     (+ x (/ (/ (* (- y z) (- t x)) (pow t_1 2.0)) t_1))
     (if (<= t_3 -5e+58)
       (+ t_4 (/ 1.0 (/ (/ (- a z) t) (- y z))))
       (if (<= t_3 -1e-254)
         (+ t_4 (/ (* (- y z) t) (- a z)))
         (if (<= t_3 0.0)
           (+ t (* (- y a) (/ (- x t) z)))
           (fma (- y z) t_2 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = cbrt((a - z));
	double t_2 = (t - x) / (a - z);
	double t_3 = x + ((y - z) * t_2);
	double t_4 = x * ((1.0 + (z / (a - z))) - (y / (a - z)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = x + ((((y - z) * (t - x)) / pow(t_1, 2.0)) / t_1);
	} else if (t_3 <= -5e+58) {
		tmp = t_4 + (1.0 / (((a - z) / t) / (y - z)));
	} else if (t_3 <= -1e-254) {
		tmp = t_4 + (((y - z) * t) / (a - z));
	} else if (t_3 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = fma((y - z), t_2, x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = cbrt(Float64(a - z))
	t_2 = Float64(Float64(t - x) / Float64(a - z))
	t_3 = Float64(x + Float64(Float64(y - z) * t_2))
	t_4 = Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(Float64(Float64(y - z) * Float64(t - x)) / (t_1 ^ 2.0)) / t_1));
	elseif (t_3 <= -5e+58)
		tmp = Float64(t_4 + Float64(1.0 / Float64(Float64(Float64(a - z) / t) / Float64(y - z))));
	elseif (t_3 <= -1e-254)
		tmp = Float64(t_4 + Float64(Float64(Float64(y - z) * t) / Float64(a - z)));
	elseif (t_3 <= 0.0)
		tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
	else
		tmp = fma(Float64(y - z), t_2, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Power[N[(a - z), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(x + N[(N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -5e+58], N[(t$95$4 + N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-254], N[(t$95$4 + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t$95$2 + x), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \sqrt[3]{a - z}\\
t_2 := \frac{t - x}{a - z}\\
t_3 := x + \left(y - z\right) \cdot t_2\\
t_4 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;x + \frac{\frac{\left(y - z\right) \cdot \left(t - x\right)}{{t_1}^{2}}}{t_1}\\

\mathbf{elif}\;t_3 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;t_4 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t_2, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0

    1. Initial program 70.1%

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

    if -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999991e-255

    1. Initial program 84.0%

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

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

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

    1. Initial program 3.7%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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. associate-*r/87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 5 regimes into one program.
  4. Final simplification97.2%

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

Alternative 2: 92.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\ t_2 := t_1 + \frac{\left(y - z\right) \cdot t}{a - z}\\ t_3 := \frac{t - x}{a - z}\\ t_4 := x + \left(y - z\right) \cdot t_3\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_1 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\ \mathbf{elif}\;t_4 \leq -1 \cdot 10^{-254}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - z, t_3, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z)))))
        (t_2 (+ t_1 (/ (* (- y z) t) (- a z))))
        (t_3 (/ (- t x) (- a z)))
        (t_4 (+ x (* (- y z) t_3))))
   (if (<= t_4 (- INFINITY))
     t_2
     (if (<= t_4 -5e+58)
       (+ t_1 (/ 1.0 (/ (/ (- a z) t) (- y z))))
       (if (<= t_4 -1e-254)
         t_2
         (if (<= t_4 0.0)
           (+ t (* (- y a) (/ (- x t) z)))
           (fma (- y z) t_3 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * ((1.0 + (z / (a - z))) - (y / (a - z)));
	double t_2 = t_1 + (((y - z) * t) / (a - z));
	double t_3 = (t - x) / (a - z);
	double t_4 = x + ((y - z) * t_3);
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_4 <= -5e+58) {
		tmp = t_1 + (1.0 / (((a - z) / t) / (y - z)));
	} else if (t_4 <= -1e-254) {
		tmp = t_2;
	} else if (t_4 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = fma((y - z), t_3, x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))))
	t_2 = Float64(t_1 + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
	t_3 = Float64(Float64(t - x) / Float64(a - z))
	t_4 = Float64(x + Float64(Float64(y - z) * t_3))
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_4 <= -5e+58)
		tmp = Float64(t_1 + Float64(1.0 / Float64(Float64(Float64(a - z) / t) / Float64(y - z))));
	elseif (t_4 <= -1e-254)
		tmp = t_2;
	elseif (t_4 <= 0.0)
		tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
	else
		tmp = fma(Float64(y - z), t_3, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$2, If[LessEqual[t$95$4, -5e+58], N[(t$95$1 + N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -1e-254], t$95$2, If[LessEqual[t$95$4, 0.0], N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t$95$3 + x), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\
t_2 := t_1 + \frac{\left(y - z\right) \cdot t}{a - z}\\
t_3 := \frac{t - x}{a - z}\\
t_4 := x + \left(y - z\right) \cdot t_3\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_4 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;t_1 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\

\mathbf{elif}\;t_4 \leq -1 \cdot 10^{-254}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - z, t_3, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999991e-255

    1. Initial program 78.4%

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

    1. Initial program 3.7%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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. associate-*r/87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 4 regimes into one program.
  4. Final simplification96.5%

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

Alternative 3: 92.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right) + \frac{\left(y - z\right) \cdot t}{a - z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-254}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1
         (+
          (* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z))))
          (/ (* (- y z) t) (- a z))))
        (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e+58)
       t_2
       (if (<= t_2 -1e-254)
         t_1
         (if (<= t_2 0.0) (+ t (* (- y a) (/ (- x t) z))) t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * ((1.0 + (z / (a - z))) - (y / (a - z)))) + (((y - z) * t) / (a - z));
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e+58) {
		tmp = t_2;
	} else if (t_2 <= -1e-254) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * ((1.0 + (z / (a - z))) - (y / (a - z)))) + (((y - z) * t) / (a - z));
	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -5e+58) {
		tmp = t_2;
	} else if (t_2 <= -1e-254) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x * ((1.0 + (z / (a - z))) - (y / (a - z)))) + (((y - z) * t) / (a - z))
	t_2 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -5e+58:
		tmp = t_2
	elif t_2 <= -1e-254:
		tmp = t_1
	elif t_2 <= 0.0:
		tmp = t + ((y - a) * ((x - t) / z))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z)))) + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e+58)
		tmp = t_2;
	elseif (t_2 <= -1e-254)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * ((1.0 + (z / (a - z))) - (y / (a - z)))) + (((y - z) * t) / (a - z));
	t_2 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -5e+58)
		tmp = t_2;
	elseif (t_2 <= -1e-254)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = t + ((y - a) * ((x - t) / z));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e+58], t$95$2, If[LessEqual[t$95$2, -1e-254], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-254}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999991e-255

    1. Initial program 78.4%

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.7%

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

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

    1. Initial program 3.7%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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. associate-*r/87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 92.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(1 + \frac{z}{a - z}\right) - \frac{y}{a - z}\right)\\ t_2 := t_1 + \frac{\left(y - z\right) \cdot t}{a - z}\\ t_3 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{+58}:\\ \;\;\;\;t_1 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-254}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- (+ 1.0 (/ z (- a z))) (/ y (- a z)))))
        (t_2 (+ t_1 (/ (* (- y z) t) (- a z))))
        (t_3 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_3 (- INFINITY))
     t_2
     (if (<= t_3 -5e+58)
       (+ t_1 (/ 1.0 (/ (/ (- a z) t) (- y z))))
       (if (<= t_3 -1e-254)
         t_2
         (if (<= t_3 0.0) (+ t (* (- y a) (/ (- x t) z))) t_3))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * ((1.0 + (z / (a - z))) - (y / (a - z)));
	double t_2 = t_1 + (((y - z) * t) / (a - z));
	double t_3 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_3 <= -5e+58) {
		tmp = t_1 + (1.0 / (((a - z) / t) / (y - z)));
	} else if (t_3 <= -1e-254) {
		tmp = t_2;
	} else if (t_3 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = t_3;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * ((1.0 + (z / (a - z))) - (y / (a - z)));
	double t_2 = t_1 + (((y - z) * t) / (a - z));
	double t_3 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_3 <= -5e+58) {
		tmp = t_1 + (1.0 / (((a - z) / t) / (y - z)));
	} else if (t_3 <= -1e-254) {
		tmp = t_2;
	} else if (t_3 <= 0.0) {
		tmp = t + ((y - a) * ((x - t) / z));
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * ((1.0 + (z / (a - z))) - (y / (a - z)))
	t_2 = t_1 + (((y - z) * t) / (a - z))
	t_3 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_3 <= -math.inf:
		tmp = t_2
	elif t_3 <= -5e+58:
		tmp = t_1 + (1.0 / (((a - z) / t) / (y - z)))
	elif t_3 <= -1e-254:
		tmp = t_2
	elif t_3 <= 0.0:
		tmp = t + ((y - a) * ((x - t) / z))
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(Float64(1.0 + Float64(z / Float64(a - z))) - Float64(y / Float64(a - z))))
	t_2 = Float64(t_1 + Float64(Float64(Float64(y - z) * t) / Float64(a - z)))
	t_3 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_3 <= -5e+58)
		tmp = Float64(t_1 + Float64(1.0 / Float64(Float64(Float64(a - z) / t) / Float64(y - z))));
	elseif (t_3 <= -1e-254)
		tmp = t_2;
	elseif (t_3 <= 0.0)
		tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * ((1.0 + (z / (a - z))) - (y / (a - z)));
	t_2 = t_1 + (((y - z) * t) / (a - z));
	t_3 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = t_2;
	elseif (t_3 <= -5e+58)
		tmp = t_1 + (1.0 / (((a - z) / t) / (y - z)));
	elseif (t_3 <= -1e-254)
		tmp = t_2;
	elseif (t_3 <= 0.0)
		tmp = t + ((y - a) * ((x - t) / z));
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(1.0 + N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -5e+58], N[(t$95$1 + N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -1e-254], t$95$2, If[LessEqual[t$95$3, 0.0], N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_3 \leq -5 \cdot 10^{+58}:\\
\;\;\;\;t_1 + \frac{1}{\frac{\frac{a - z}{t}}{y - z}}\\

\mathbf{elif}\;t_3 \leq -1 \cdot 10^{-254}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0 or -4.99999999999999986e58 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999991e-255

    1. Initial program 78.4%

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.99999999999999986e58

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

    1. Initial program 3.7%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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. associate-*r/87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.3%

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

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

Alternative 5: 91.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_1 (- INFINITY))
     (* (- t x) (/ y (- a z)))
     (if (or (<= t_1 -5e-236) (not (<= t_1 0.0)))
       t_1
       (- t (* (- t x) (/ (- y a) z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) * ((y - a) / z));
	}
	return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) * ((y - a) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (t - x) * (y / (a - z))
	elif (t_1 <= -5e-236) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t - ((t - x) * ((y - a) / z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif ((t_1 <= -5e-236) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t - Float64(Float64(t - x) * Float64(Float64(y - a) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (t - x) * (y / (a - z));
	elseif ((t_1 <= -5e-236) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t - ((t - x) * ((y - a) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-236], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t - N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $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 -\infty:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-236 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 94.4%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{1}{\frac{z}{y - a}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_1 (- INFINITY))
     (* (- t x) (/ y (- a z)))
     (if (or (<= t_1 -5e-236) (not (<= t_1 0.0)))
       t_1
       (- t (* (- t x) (/ 1.0 (/ z (- y a)))))))))
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 <= -((double) INFINITY)) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) * (1.0 / (z / (y - a))));
	}
	return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) * (1.0 / (z / (y - a))));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (t - x) * (y / (a - z))
	elif (t_1 <= -5e-236) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t - ((t - x) * (1.0 / (z / (y - a))))
	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 <= Float64(-Inf))
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif ((t_1 <= -5e-236) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t - Float64(Float64(t - x) * Float64(1.0 / Float64(z / Float64(y - a)))));
	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 <= -Inf)
		tmp = (t - x) * (y / (a - z));
	elseif ((t_1 <= -5e-236) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t - ((t - x) * (1.0 / (z / (y - a))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-236], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t - N[(N[(t - x), $MachinePrecision] * N[(1.0 / N[(z / N[(y - a), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-236 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 94.4%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{\frac{z}{y - a}}} \]
      2. div-inv96.9%

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

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

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

Alternative 7: 91.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_1 (- INFINITY))
     (* (- t x) (/ y (- a z)))
     (if (or (<= t_1 -5e-236) (not (<= t_1 0.0)))
       t_1
       (+ t (* (- y a) (/ (- x t) z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + ((y - a) * ((x - t) / z));
	}
	return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
		tmp = (t - x) * (y / (a - z));
	} else if ((t_1 <= -5e-236) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t + ((y - a) * ((x - t) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (t - x) * (y / (a - z))
	elif (t_1 <= -5e-236) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t + ((y - a) * ((x - t) / z))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z)));
	elseif ((t_1 <= -5e-236) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (t - x) * (y / (a - z));
	elseif ((t_1 <= -5e-236) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t + ((y - a) * ((x - t) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-236], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t + N[(N[(y - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $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 -\infty:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\

\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-236} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999998e-236 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 94.4%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-151}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.26 \cdot 10^{-169}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-113}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 1.06 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.7999999999999999e107 or 1.06000000000000003e-37 < z

    1. Initial program 67.2%

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

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

    if -1.7999999999999999e107 < z < -3.4000000000000003e-151

    1. Initial program 92.4%

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

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

    if -3.4000000000000003e-151 < z < 1.26e-169 or 7.00000000000000057e-113 < z < 1.06000000000000003e-37

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if 1.26e-169 < z < 7.00000000000000057e-113

    1. Initial program 85.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+107}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-151}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{-169}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-113}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{-37}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;x - \frac{z}{t_1}\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-12} \lor \neg \left(z \leq 3.65 \cdot 10^{-115}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.59999999999999969e104 or -2.4e18 < z < -1.84999999999999999e-12 or 3.64999999999999982e-115 < z

    1. Initial program 71.6%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 69.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}} \]
    6. Step-by-step derivation
      1. associate--l+69.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. associate-*r/69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999969e104 < z < -2.4e18

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.84999999999999999e-12 < z < 3.64999999999999982e-115

    1. Initial program 90.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+104}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{z}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-12} \lor \neg \left(z \leq 3.65 \cdot 10^{-115}\right):\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 60.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -1.05 \cdot 10^{-124}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 2.4 \cdot 10^{+74}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.0500000000000001e140 or 2.40000000000000008e74 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

    if -1.0500000000000001e140 < a < -1.05e-124 or -8.0000000000000002e-224 < a < 2.40000000000000008e74

    1. Initial program 75.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    6. Step-by-step derivation
      1. div-inv65.1%

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

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

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

    if -1.05e-124 < a < -8.0000000000000002e-224

    1. Initial program 73.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{+140}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-124}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-224}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 72.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-13} \lor \neg \left(z \leq 3.65 \cdot 10^{-115}\right):\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.99999999999999984e-13 or 3.64999999999999982e-115 < z

    1. Initial program 72.8%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 67.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}} \]
    6. Step-by-step derivation
      1. associate--l+67.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. associate-*r/67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999984e-13 < z < 3.64999999999999982e-115

    1. Initial program 90.6%

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

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

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

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

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

Alternative 12: 60.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-12} \lor \neg \left(z \leq 6.4 \cdot 10^{-114}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.89999999999999998e-12 or 6.4000000000000003e-114 < z

    1. Initial program 72.7%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    6. Step-by-step derivation
      1. div-inv61.9%

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

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

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

    if -1.89999999999999998e-12 < z < 6.4000000000000003e-114

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

Alternative 13: 64.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+39} \lor \neg \left(z \leq 1.8 \cdot 10^{-113}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5000000000000001e39 or 1.79999999999999987e-113 < z

    1. Initial program 70.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    6. Step-by-step derivation
      1. div-inv62.9%

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

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

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

    if -6.5000000000000001e39 < z < 1.79999999999999987e-113

    1. Initial program 91.4%

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

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

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

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

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

Alternative 14: 67.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-14} \lor \neg \left(z \leq 3.65 \cdot 10^{-115}\right):\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.599999999999999e-14 or 3.64999999999999982e-115 < z

    1. Initial program 72.8%

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

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \left(t - x\right)\right)} \]
    5. Taylor expanded in z around inf 67.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}} \]
    6. Step-by-step derivation
      1. associate--l+67.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. associate-*r/67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.599999999999999e-14 < z < 3.64999999999999982e-115

    1. Initial program 90.6%

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

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

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

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

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

Alternative 15: 54.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+106} \lor \neg \left(z \leq 3.7 \cdot 10^{-36}\right):\\
\;\;\;\;\frac{z}{a - z} \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.00000000000000009e106 or 3.70000000000000002e-36 < z

    1. Initial program 67.5%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

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

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

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

    if -1.00000000000000009e106 < z < 3.70000000000000002e-36

    1. Initial program 89.6%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Simplified57.9%

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

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

Alternative 16: 54.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+105}:\\
\;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\

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

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


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

    1. Initial program 61.7%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

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

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

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

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

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

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

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

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

    if -2.2500000000000001e105 < z < 5.6999999999999999e-36

    1. Initial program 89.6%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Simplified57.9%

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

    if 5.6999999999999999e-36 < z

    1. Initial program 71.9%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
    8. Simplified63.3%

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

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

Alternative 17: 53.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

    if -6.59999999999999969e104 < z < 5.6999999999999999e-36

    1. Initial program 89.6%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Simplified57.9%

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

    if 5.6999999999999999e-36 < z

    1. Initial program 71.9%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a - z}} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
    8. Simplified63.3%

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

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

Alternative 18: 51.8% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.1999999999999998e105 or 1.04999999999999995e-29 < z

    1. Initial program 66.9%

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

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

    if -7.1999999999999998e105 < z < 1.04999999999999995e-29

    1. Initial program 89.7%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    8. Simplified57.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+105}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-29}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 37.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 0.0036:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.99999999999999944e132 or 0.0035999999999999999 < a

    1. Initial program 88.8%

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

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

    if -8.99999999999999944e132 < a < 0.0035999999999999999

    1. Initial program 75.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{+132}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 0.0036:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 37.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 0.0033:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.1999999999999999e54

    1. Initial program 85.8%

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

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

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

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

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

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

    if -2.1999999999999999e54 < a < 0.0033

    1. Initial program 74.6%

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

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

    if 0.0033 < a

    1. Initial program 88.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{+54}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;a \leq 0.0033:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 24.9% 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.0%

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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