Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 91.4%
Time: 19.6s
Alternatives: 21
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 91.4% accurate, 0.1× speedup?

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

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

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

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


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

    1. Initial program 93.5%

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

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

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

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

    if -4.9999999999999997e-246 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-264

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-264 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 93.5%

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

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

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

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

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

Alternative 2: 91.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{-246} \lor \neg \left(t_1 \leq 2 \cdot 10^{-264}\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 (or (<= t_1 -5e-246) (not (<= t_1 2e-264)))
     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 <= -5e-246) || !(t_1 <= 2e-264)) {
		tmp = t_1;
	} else {
		tmp = t + ((y - a) * ((x - t) / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-5d-246)) .or. (.not. (t_1 <= 2d-264))) then
        tmp = t_1
    else
        tmp = t + ((y - a) * ((x - t) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -5e-246) || !(t_1 <= 2e-264)) {
		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 <= -5e-246) or not (t_1 <= 2e-264):
		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 <= -5e-246) || !(t_1 <= 2e-264))
		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 <= -5e-246) || ~((t_1 <= 2e-264)))
		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[Or[LessEqual[t$95$1, -5e-246], N[Not[LessEqual[t$95$1, 2e-264]], $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 -5 \cdot 10^{-246} \lor \neg \left(t_1 \leq 2 \cdot 10^{-264}\right):\\
\;\;\;\;t_1\\

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


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

    1. Initial program 93.5%

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

    if -4.9999999999999997e-246 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-264

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-246} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 2 \cdot 10^{-264}\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} \]

Alternative 3: 91.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 93.5%

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

    if -4.9999999999999997e-246 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-264

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-264 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 93.5%

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

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

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

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

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

Alternative 4: 91.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 93.5%

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

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

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

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

    if -4.9999999999999997e-246 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2e-264

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-264 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 93.5%

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

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

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

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

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

Alternative 5: 59.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ t_2 := x + \frac{y}{\frac{a}{t}}\\ \mathbf{if}\;a \leq -4 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+40}:\\ \;\;\;\;x + \frac{y}{\frac{-a}{x}}\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{+179}:\\ \;\;\;\;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 (/ y (/ a t)))))
   (if (<= a -4e+40)
     t_2
     (if (<= a 7.9e-50)
       t_1
       (if (<= a 2.9e+40)
         (+ x (/ y (/ (- a) x)))
         (if (<= a 8.8e+179) 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 + (y / (a / t));
	double tmp;
	if (a <= -4e+40) {
		tmp = t_2;
	} else if (a <= 7.9e-50) {
		tmp = t_1;
	} else if (a <= 2.9e+40) {
		tmp = x + (y / (-a / x));
	} else if (a <= 8.8e+179) {
		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 + (y / (a / t))
    if (a <= (-4d+40)) then
        tmp = t_2
    else if (a <= 7.9d-50) then
        tmp = t_1
    else if (a <= 2.9d+40) then
        tmp = x + (y / (-a / x))
    else if (a <= 8.8d+179) 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 + (y / (a / t));
	double tmp;
	if (a <= -4e+40) {
		tmp = t_2;
	} else if (a <= 7.9e-50) {
		tmp = t_1;
	} else if (a <= 2.9e+40) {
		tmp = x + (y / (-a / x));
	} else if (a <= 8.8e+179) {
		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 + (y / (a / t))
	tmp = 0
	if a <= -4e+40:
		tmp = t_2
	elif a <= 7.9e-50:
		tmp = t_1
	elif a <= 2.9e+40:
		tmp = x + (y / (-a / x))
	elif a <= 8.8e+179:
		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(y / Float64(a / t)))
	tmp = 0.0
	if (a <= -4e+40)
		tmp = t_2;
	elseif (a <= 7.9e-50)
		tmp = t_1;
	elseif (a <= 2.9e+40)
		tmp = Float64(x + Float64(y / Float64(Float64(-a) / x)));
	elseif (a <= 8.8e+179)
		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 + (y / (a / t));
	tmp = 0.0;
	if (a <= -4e+40)
		tmp = t_2;
	elseif (a <= 7.9e-50)
		tmp = t_1;
	elseif (a <= 2.9e+40)
		tmp = x + (y / (-a / x));
	elseif (a <= 8.8e+179)
		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[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4e+40], t$95$2, If[LessEqual[a, 7.9e-50], t$95$1, If[LessEqual[a, 2.9e+40], N[(x + N[(y / N[((-a) / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e+179], 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{y}{\frac{a}{t}}\\
\mathbf{if}\;a \leq -4 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 7.9 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+40}:\\
\;\;\;\;x + \frac{y}{\frac{-a}{x}}\\

\mathbf{elif}\;a \leq 8.8 \cdot 10^{+179}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.00000000000000012e40 or 8.8000000000000002e179 < a

    1. Initial program 91.7%

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

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

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

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

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

    if -4.00000000000000012e40 < a < 7.9000000000000002e-50 or 2.90000000000000017e40 < a < 8.8000000000000002e179

    1. Initial program 75.2%

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

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

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

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

    if 7.9000000000000002e-50 < a < 2.90000000000000017e40

    1. Initial program 86.2%

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

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{-1 \cdot \frac{a}{x}}} \]
    6. Step-by-step derivation
      1. associate-*r/62.6%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{-1 \cdot a}{x}}} \]
      2. neg-mul-162.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4 \cdot 10^{+40}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;a \leq 7.9 \cdot 10^{-50}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+40}:\\ \;\;\;\;x + \frac{y}{\frac{-a}{x}}\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{+179}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \]

Alternative 6: 54.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-223}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 4.9 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.05e25 or 4.8999999999999997e63 < z

    1. Initial program 67.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{a - z}{z}}} \]
      3. neg-mul-158.7%

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

        \[\leadsto \frac{-t}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      5. *-inverses58.7%

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

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

    if -1.05e25 < z < 3.2000000000000001e-223 or 2.09999999999999992e-98 < z < 4.8999999999999997e63

    1. Initial program 91.7%

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

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

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

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

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

    if 3.2000000000000001e-223 < z < 2.09999999999999992e-98

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{-1 \cdot \frac{a}{x}}} \]
    6. Step-by-step derivation
      1. associate-*r/76.8%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{-1 \cdot a}{x}}} \]
      2. neg-mul-176.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+25}:\\ \;\;\;\;\frac{-t}{\frac{a}{z} + -1}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-223}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-98}:\\ \;\;\;\;x + \frac{y}{\frac{-a}{x}}\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+63}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t}{\frac{a}{z} + -1}\\ \end{array} \]

Alternative 7: 55.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-99}:\\
\;\;\;\;x + \frac{y}{\frac{-a}{x}}\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+51}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0999999999999998e25 or 2.69999999999999992e51 < z

    1. Initial program 67.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{z}{y - z}}} \]
      3. neg-mul-159.3%

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

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

    if -3.0999999999999998e25 < z < 3.3999999999999998e-223 or 9.0000000000000006e-99 < z < 2.69999999999999992e51

    1. Initial program 92.3%

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

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

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

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

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

    if 3.3999999999999998e-223 < z < 9.0000000000000006e-99

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{-1 \cdot \frac{a}{x}}} \]
    6. Step-by-step derivation
      1. associate-*r/76.8%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{-1 \cdot a}{x}}} \]
      2. neg-mul-176.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+25}:\\ \;\;\;\;\frac{-t}{\frac{z}{y - z}}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-223}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-99}:\\ \;\;\;\;x + \frac{y}{\frac{-a}{x}}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+51}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t}{\frac{z}{y - z}}\\ \end{array} \]

Alternative 8: 52.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-226}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+59}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2000000000000002e26 or 1.1e59 < z

    1. Initial program 67.4%

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

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

    if -4.2000000000000002e26 < z < 1.0500000000000001e-226 or 5.6000000000000001e-99 < z < 1.1e59

    1. Initial program 92.4%

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

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

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

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

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

    if 1.0500000000000001e-226 < z < 5.6000000000000001e-99

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{-1 \cdot \frac{a}{x}}} \]
    6. Step-by-step derivation
      1. associate-*r/76.8%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{-1 \cdot a}{x}}} \]
      2. neg-mul-176.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+26}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-226}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-99}:\\ \;\;\;\;x + \frac{y}{\frac{-a}{x}}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+59}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 75.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+24} \lor \neg \left(z \leq 8 \cdot 10^{+36}\right):\\
\;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.19999999999999966e24 or 8.00000000000000034e36 < z

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999966e24 < z < 8.00000000000000034e36

    1. Initial program 94.4%

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

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

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

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

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

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

Alternative 10: 73.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{-1 \cdot x}{\frac{z}{y - a}}} \]
      3. neg-mul-176.4%

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

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

    if -1.9000000000000001e26 < z < 1.3e37

    1. Initial program 94.4%

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

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

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

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

    if 1.3e37 < z

    1. Initial program 67.0%

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

      \[\leadsto \color{blue}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. associate--l+55.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/55.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/55.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-sub55.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--55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+26}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y - a}}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+37}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{\frac{z}{t - x}}\\ \end{array} \]

Alternative 11: 72.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{-1 \cdot x}{\frac{z}{y - a}}} \]
      3. neg-mul-176.4%

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

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

    if -1.7000000000000001e26 < z < 9.99999999999999954e36

    1. Initial program 94.4%

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

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

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

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

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

    if 9.99999999999999954e36 < z

    1. Initial program 67.0%

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

      \[\leadsto \color{blue}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. associate--l+55.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/55.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/55.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-sub55.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--55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 39.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-92}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2000000000000001e25 or 2.59999999999999988e58 < z

    1. Initial program 67.4%

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

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

    if -2.2000000000000001e25 < z < -1.25000000000000003e-92 or 2.59999999999999983e-218 < z < 2.59999999999999988e58

    1. Initial program 92.1%

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

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

    if -1.25000000000000003e-92 < z < 2.59999999999999983e-218

    1. Initial program 96.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+25}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-218}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 13: 43.6% accurate, 1.0× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25e26 or 3.0000000000000002e58 < z

    1. Initial program 67.4%

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

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

    if -1.25e26 < z < -5.79999999999999978e-30 or 4.4000000000000002e-147 < z < 3.0000000000000002e58

    1. Initial program 88.8%

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

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

    if -5.79999999999999978e-30 < z < 4.4000000000000002e-147

    1. Initial program 97.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+26}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-147}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 67.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+37} \lor \neg \left(z \leq 3.3 \cdot 10^{-13}\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 -3.2e+37) (not (<= z 3.3e-13)))
   (* 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 <= -3.2e+37) || !(z <= 3.3e-13)) {
		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 <= (-3.2d+37)) .or. (.not. (z <= 3.3d-13))) 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 <= -3.2e+37) || !(z <= 3.3e-13)) {
		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 <= -3.2e+37) or not (z <= 3.3e-13):
		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 <= -3.2e+37) || !(z <= 3.3e-13))
		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 <= -3.2e+37) || ~((z <= 3.3e-13)))
		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, -3.2e+37], N[Not[LessEqual[z, 3.3e-13]], $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 -3.2 \cdot 10^{+37} \lor \neg \left(z \leq 3.3 \cdot 10^{-13}\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 < -3.20000000000000014e37 or 3.3000000000000001e-13 < z

    1. Initial program 67.2%

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

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

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

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

    if -3.20000000000000014e37 < z < 3.3000000000000001e-13

    1. Initial program 96.5%

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

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

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

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

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

Alternative 15: 70.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.79999999999999967e25 or 9.19999999999999986e36 < z

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999967e25 < z < 9.19999999999999986e36

    1. Initial program 94.4%

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

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

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

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

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

Alternative 16: 70.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{-1 \cdot x}{\frac{z}{y - a}}} \]
      3. neg-mul-176.4%

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

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

    if -2.8500000000000002e26 < z < 9.19999999999999986e36

    1. Initial program 94.4%

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

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

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

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

    if 9.19999999999999986e36 < z

    1. Initial program 67.0%

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

      \[\leadsto \color{blue}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. associate--l+55.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/55.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/55.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-sub55.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--55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+26}:\\ \;\;\;\;t + \frac{x}{\frac{z}{y - a}}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+36}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{\frac{z}{t - x}}\\ \end{array} \]

Alternative 17: 38.4% accurate, 1.2× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+59}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35e25 or 1.3e59 < z

    1. Initial program 67.4%

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

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

    if -1.35e25 < z < -1.1499999999999999e-93 or 7.99999999999999966e-233 < z < 1.3e59

    1. Initial program 92.1%

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

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

    if -1.1499999999999999e-93 < z < 7.99999999999999966e-233

    1. Initial program 96.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+25}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-93}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-233}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+59}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 18: 37.7% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-94}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.60000000000000002e26 or 9.5000000000000002e58 < z

    1. Initial program 67.4%

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

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

    if -2.60000000000000002e26 < z < -7.5000000000000003e-94 or 4.50000000000000009e-234 < z < 9.5000000000000002e58

    1. Initial program 92.1%

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

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

    if -7.5000000000000003e-94 < z < 4.50000000000000009e-234

    1. Initial program 96.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+26}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-94}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-234}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 19: 53.1% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000002e26 or 5.80000000000000004e58 < z

    1. Initial program 67.4%

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

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

    if -4.2000000000000002e26 < z < 5.80000000000000004e58

    1. Initial program 93.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+26}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+58}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 20: 39.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.50000000000000005e25 or 2.30000000000000002e58 < z

    1. Initial program 67.4%

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

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

    if -6.50000000000000005e25 < z < 2.30000000000000002e58

    1. Initial program 93.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+25}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+58}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 21: 25.8% 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.8%

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification30.5%

    \[\leadsto t \]

Reproduce

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