Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.5% → 93.1%
Time: 17.5s
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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 93.1% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{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)))) < -2.0000000000000001e-292 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.8% accurate, 0.2× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000005e-4 or 1.00000000000000007e-285 < (+.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. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num93.4%

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

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

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

    if -1.00000000000000005e-4 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -2.0000000000000001e-292

    1. Initial program 66.6%

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

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

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

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

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

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

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.7% 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 -2 \cdot 10^{-292} \lor \neg \left(t\_1 \leq 10^{-285}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{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 -2e-292) (not (<= t_1 1e-285)))
     t_1
     (- t (/ (* (- t x) (- y a)) z)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -2e-292) || !(t_1 <= 1e-285)) {
		tmp = t_1;
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-2d-292)) .or. (.not. (t_1 <= 1d-285))) then
        tmp = t_1
    else
        tmp = t - (((t - x) * (y - a)) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -2e-292) || !(t_1 <= 1e-285)) {
		tmp = t_1;
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -2e-292) or not (t_1 <= 1e-285):
		tmp = t_1
	else:
		tmp = t - (((t - x) * (y - a)) / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if ((t_1 <= -2e-292) || !(t_1 <= 1e-285))
		tmp = t_1;
	else
		tmp = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	tmp = 0.0;
	if ((t_1 <= -2e-292) || ~((t_1 <= 1e-285)))
		tmp = t_1;
	else
		tmp = t - (((t - x) * (y - a)) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-292], N[Not[LessEqual[t$95$1, 1e-285]], $MachinePrecision]], t$95$1, N[(t - N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $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 -2 \cdot 10^{-292} \lor \neg \left(t\_1 \leq 10^{-285}\right):\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{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)))) < -2.0000000000000001e-292 or 1.00000000000000007e-285 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.8%

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.7% 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 -2 \cdot 10^{-292}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 10^{-285}:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{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 -2e-292)
     t_1
     (if (<= t_1 1e-285)
       (- t (/ (* (- t x) (- y a)) 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 <= -2e-292) {
		tmp = t_1;
	} else if (t_1 <= 1e-285) {
		tmp = t - (((t - x) * (y - a)) / 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 <= (-2d-292)) then
        tmp = t_1
    else if (t_1 <= 1d-285) then
        tmp = t - (((t - x) * (y - a)) / 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 <= -2e-292) {
		tmp = t_1;
	} else if (t_1 <= 1e-285) {
		tmp = t - (((t - x) * (y - a)) / 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 <= -2e-292:
		tmp = t_1
	elif t_1 <= 1e-285:
		tmp = t - (((t - x) * (y - a)) / 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 <= -2e-292)
		tmp = t_1;
	elseif (t_1 <= 1e-285)
		tmp = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / 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 <= -2e-292)
		tmp = t_1;
	elseif (t_1 <= 1e-285)
		tmp = t - (((t - x) * (y - a)) / 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, -2e-292], t$95$1, If[LessEqual[t$95$1, 1e-285], N[(t - N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $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 -2 \cdot 10^{-292}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 10^{-285}:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{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)))) < -2.0000000000000001e-292

    1. Initial program 90.9%

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.7%

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

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

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

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

Alternative 5: 63.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5.3 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 45.7%

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

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

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

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

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

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

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

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

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

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

    if -5.7000000000000002e180 < z < -1.5200000000000001e-106 or 0.029499999999999998 < z < 5.3000000000000002e116

    1. Initial program 81.1%

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

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

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

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

      \[\leadsto x + \frac{y - z}{\color{blue}{-1 \cdot \frac{z}{t - x} + \frac{a}{t - x}}} \]
    6. Step-by-step derivation
      1. +-commutative81.2%

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

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

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

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

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

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

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

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

    if -1.5200000000000001e-106 < z < 0.029499999999999998

    1. Initial program 94.9%

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

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

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

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

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

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

    if 5.3000000000000002e116 < z

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-66}:\\
\;\;\;\;x + y \cdot \frac{x - t}{z}\\

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

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


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

    1. Initial program 59.0%

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e85 < z < -7.49999999999999995e-66

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999995e-66 < z < 5.6000000000000003e24

    1. Initial program 92.4%

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

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

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

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

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

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

    if 5.6000000000000003e24 < z

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-66}:\\ \;\;\;\;x + y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+24}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x \cdot y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.05 \cdot 10^{+72} \lor \neg \left(z \leq 9.5 \cdot 10^{+26}\right):\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.04999999999999996e72 or 9.50000000000000054e26 < z

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

    if -3.04999999999999996e72 < z < 9.50000000000000054e26

    1. Initial program 92.2%

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

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

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

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

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

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

Alternative 8: 75.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+72} \lor \neg \left(z \leq 2.8 \cdot 10^{+27}\right):\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.00000000000000003e72 or 2.7999999999999999e27 < z

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

    if -3.00000000000000003e72 < z < 2.7999999999999999e27

    1. Initial program 92.2%

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

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

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

Alternative 9: 71.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+130} \lor \neg \left(x \leq 2.1 \cdot 10^{+54}\right):\\
\;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.9000000000000002e130 or 2.09999999999999986e54 < x

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9000000000000002e130 < x < 2.09999999999999986e54

    1. Initial program 83.7%

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

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

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

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

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

Alternative 10: 67.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.08 \cdot 10^{-106} \lor \neg \left(z \leq 10^{+26}\right):\\
\;\;\;\;t + y \cdot \frac{x - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0800000000000001e-106 or 1.00000000000000005e26 < z

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

    if -2.0800000000000001e-106 < z < 1.00000000000000005e26

    1. Initial program 93.6%

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

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

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

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

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

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

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

Alternative 11: 62.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e75 < z < 2.7999999999999999e27

    1. Initial program 92.3%

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

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

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

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

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

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

    if 2.7999999999999999e27 < z

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e75 < z < 4.6000000000000001e26

    1. Initial program 92.3%

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

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

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

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

    if 4.6000000000000001e26 < z

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 59.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999999e75 < z < 5.3e29

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if 5.3e29 < z

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 56.4% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    8. Step-by-step derivation
      1. mul-1-neg57.1%

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

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

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

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

    if -2.3e72 < z < 0.0048999999999999998

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

    if 0.0048999999999999998 < z

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 38.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+85} \lor \neg \left(z \leq 7.5 \cdot 10^{-5}\right):\\
\;\;\;\;t \cdot \left(\frac{a}{z} + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000002e85 or 7.49999999999999934e-5 < z

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

    if -4.2000000000000002e85 < z < 7.49999999999999934e-5

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 56.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    8. Step-by-step derivation
      1. mul-1-neg59.0%

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

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

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

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

    if -2.40000000000000008e74 < z < 7.49999999999999987e23

    1. Initial program 92.3%

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

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

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

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

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

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

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

    if 7.49999999999999987e23 < z

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 54.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-90}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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

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


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

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999994e-90 < z < 2e27

    1. Initial program 93.6%

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

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

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

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

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

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

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

    if 2e27 < z

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 43.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{-95}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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

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


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

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22e-95 < z < 1.24999999999999992e-103

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999992e-103 < z

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 47.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 80.3%

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

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

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

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

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

    if -2.1999999999999999e40 < a < 2.1499999999999999e92

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1499999999999999e92 < a

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 38.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 0.0025:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.6999999999999998e61 or 0.00250000000000000005 < z

    1. Initial program 65.8%

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

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

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

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

      \[\leadsto x + \frac{y - z}{\color{blue}{-1 \cdot \frac{z}{t - x} + \frac{a}{t - x}}} \]
    6. Step-by-step derivation
      1. +-commutative64.6%

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

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

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

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

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

    if -4.6999999999999998e61 < z < 0.00250000000000000005

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 24.9% accurate, 13.0× speedup?

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

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

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

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

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

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

    \[\leadsto x + \frac{y - z}{\color{blue}{-1 \cdot \frac{z}{t - x} + \frac{a}{t - x}}} \]
  6. Step-by-step derivation
    1. +-commutative79.6%

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

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

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

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

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

Reproduce

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