Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3

Percentage Accurate: 68.3% → 90.8%
Time: 17.0s
Alternatives: 23
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 23 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: 68.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 90.8% accurate, 0.1× speedup?

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

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

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

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


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

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

      \[\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+99.5%

        \[\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/99.5%

        \[\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/99.5%

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

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

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

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

        \[\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/99.5%

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

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

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

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

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

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

    1. Initial program 69.3%

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

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

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

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

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

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

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

Alternative 2: 91.0% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-275}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+304}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 48.1%

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

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

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

    if -5.00000000000000029e278 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -4.99999999999999983e-275 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 3.9999999999999998e304

    1. Initial program 95.1%

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

      \[\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+99.5%

        \[\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/99.5%

        \[\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/99.5%

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

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

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

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

        \[\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/99.5%

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

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

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

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

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

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

Alternative 3: 90.8% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

      \[\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+99.5%

        \[\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/99.5%

        \[\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/99.5%

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

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

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

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

        \[\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/99.5%

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

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

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

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

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

Alternative 4: 57.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+130}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.04999999999999989e130

    1. Initial program 32.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.04999999999999989e130 < z < -2.35e-88

    1. Initial program 71.9%

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

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

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

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

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

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

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

    if -2.35e-88 < z < -3.0499999999999999e-167

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{y}{a}\right)} \]
    14. Simplified73.0%

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

    if -3.0499999999999999e-167 < z < 3.55000000000000021e143

    1. Initial program 88.8%

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

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

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

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

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

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

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

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+130}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{-88}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq -3.05 \cdot 10^{-167}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 53.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+109}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.2200000000000001e109

    1. Initial program 34.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2200000000000001e109 < z < -1.1200000000000001e-167

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1200000000000001e-167 < z < 1.7e-33

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7e-33 < z < 3.55000000000000021e143

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t - -1 \cdot x}{z}} \]
      4. cancel-sign-sub-inv43.9%

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

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

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

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

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

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

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+109}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-167}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-33}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 54.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+70}:\\
\;\;\;\;x \cdot \left(\frac{t}{x} - \frac{a}{z}\right)\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.45000000000000014e70

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified57.2%

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

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

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

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

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

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

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

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified56.9%

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

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

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

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

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

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

    if -2.45000000000000014e70 < z < -1.49999999999999996e-168

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999996e-168 < z < 3.2e-30

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e-30 < z < 3.55000000000000021e143

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t - -1 \cdot x}{z}} \]
      4. cancel-sign-sub-inv43.9%

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

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

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

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

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

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

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.45 \cdot 10^{+70}:\\ \;\;\;\;x \cdot \left(\frac{t}{x} - \frac{a}{z}\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 54.1% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.3999999999999999e70

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified57.2%

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

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

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

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

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

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

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

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified56.9%

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

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

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

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

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

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

    if -5.3999999999999999e70 < z < -2.95000000000000011e-167

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.95000000000000011e-167 < z < 8.000000000000001e-30

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.000000000000001e-30 < z < 3.55000000000000021e143

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t - -1 \cdot x}{z}} \]
      4. cancel-sign-sub-inv43.9%

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

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

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

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

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

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

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

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

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

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

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

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

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

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

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified68.1%

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

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

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

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

        \[\leadsto \color{blue}{t - a \cdot \frac{x}{z}} \]
    16. Simplified68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+70}:\\ \;\;\;\;x \cdot \left(\frac{t}{x} - \frac{a}{z}\right)\\ \mathbf{elif}\;z \leq -2.95 \cdot 10^{-167}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 54.9% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.01999999999999999e114 or 3.55000000000000021e143 < z

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.01999999999999999e114 < z < -3.8e-168

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e-168 < z < 8.000000000000001e-31

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.000000000000001e-31 < z < 3.55000000000000021e143

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t - -1 \cdot x}{z}} \]
      4. cancel-sign-sub-inv43.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+114}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-31}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4999999999999998e108 or 3.55000000000000021e143 < z

    1. Initial program 35.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999998e108 < z < -2.9999999999999998e-167

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999998e-167 < z < 3.55000000000000021e143

    1. Initial program 88.8%

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

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

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

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

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

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

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

Alternative 10: 52.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t + a \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.7000000000000001e99 or 3.55000000000000021e143 < z

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t}{z}} \]
    13. Simplified61.7%

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

    if -3.7000000000000001e99 < z < -1.55e-168

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e-168 < z < 3.55000000000000021e143

    1. Initial program 88.8%

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

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

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

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

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

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

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

Alternative 11: 74.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+136} \lor \neg \left(y \leq 1.5 \cdot 10^{+53}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t - x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8000000000000001e136 or 1.49999999999999999e53 < y

    1. Initial program 73.5%

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

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

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. 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}}} \]
    6. Applied egg-rr92.3%

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

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

    if -4.8000000000000001e136 < y < 1.49999999999999999e53

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 72.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.86 \cdot 10^{+143} \lor \neg \left(x \leq 7 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot \left(\frac{y - z}{z - a} + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8599999999999999e143 or 7.00000000000000005e70 < x

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8599999999999999e143 < x < 7.00000000000000005e70

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 72.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+143} \lor \neg \left(x \leq 4 \cdot 10^{+70}\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 -1.45e+143) (not (<= x 4e+70)))
   (* 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 <= -1.45e+143) || !(x <= 4e+70)) {
		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 <= (-1.45d+143)) .or. (.not. (x <= 4d+70))) 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 <= -1.45e+143) || !(x <= 4e+70)) {
		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 <= -1.45e+143) or not (x <= 4e+70):
		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 <= -1.45e+143) || !(x <= 4e+70))
		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 <= -1.45e+143) || ~((x <= 4e+70)))
		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, -1.45e+143], N[Not[LessEqual[x, 4e+70]], $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 -1.45 \cdot 10^{+143} \lor \neg \left(x \leq 4 \cdot 10^{+70}\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 < -1.4499999999999999e143 or 4.00000000000000029e70 < x

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e143 < x < 4.00000000000000029e70

    1. Initial program 73.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+143} \lor \neg \left(x \leq 4 \cdot 10^{+70}\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 14: 75.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 69.1%

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

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

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

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

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

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

    if -3.19999999999999979e-87 < a < 1.84999999999999989e-140

    1. Initial program 64.8%

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

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

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

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

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

      \[\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 84.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+84.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/84.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/84.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-neg84.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-sub84.7%

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

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

        \[\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/84.7%

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

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

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

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

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

    if 1.84999999999999989e-140 < a

    1. Initial program 75.2%

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

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

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

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

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*91.2%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out91.2%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative91.2%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub91.2%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out91.2%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg91.2%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/95.2%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified95.2%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in t around inf 82.5%

      \[\leadsto x + \frac{\color{blue}{t}}{\frac{a - z}{y - z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{-87}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-140}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y - z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 74.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+132}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+53}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t - x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -2.7e+132)
   (+ x (/ (- t x) (/ (- a z) y)))
   (if (<= y 5.5e+53)
     (+ x (/ t (/ (- a z) (- y z))))
     (+ x (/ y (/ (- a z) (- t x)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -2.7e+132) {
		tmp = x + ((t - x) / ((a - z) / y));
	} else if (y <= 5.5e+53) {
		tmp = x + (t / ((a - z) / (y - 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 (y <= (-2.7d+132)) then
        tmp = x + ((t - x) / ((a - z) / y))
    else if (y <= 5.5d+53) then
        tmp = x + (t / ((a - z) / (y - 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 (y <= -2.7e+132) {
		tmp = x + ((t - x) / ((a - z) / y));
	} else if (y <= 5.5e+53) {
		tmp = x + (t / ((a - z) / (y - z)));
	} else {
		tmp = x + (y / ((a - z) / (t - x)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -2.7e+132:
		tmp = x + ((t - x) / ((a - z) / y))
	elif y <= 5.5e+53:
		tmp = x + (t / ((a - z) / (y - z)))
	else:
		tmp = x + (y / ((a - z) / (t - x)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -2.7e+132)
		tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / y)));
	elseif (y <= 5.5e+53)
		tmp = Float64(x + Float64(t / Float64(Float64(a - z) / Float64(y - 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 (y <= -2.7e+132)
		tmp = x + ((t - x) / ((a - z) / y));
	elseif (y <= 5.5e+53)
		tmp = x + (t / ((a - z) / (y - z)));
	else
		tmp = x + (y / ((a - z) / (t - x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.7e+132], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+53], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $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}\;y \leq -2.7 \cdot 10^{+132}:\\
\;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+53}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t - x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7e132

    1. Initial program 69.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*88.2%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified88.2%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 69.1%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{a - z} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg69.1%

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*82.8%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out82.8%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative82.8%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub82.8%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out88.2%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg88.2%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/96.8%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified96.8%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in y around inf 89.8%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{a - z}{y}}} \]

    if -2.7e132 < y < 5.49999999999999975e53

    1. Initial program 67.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*76.5%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified76.5%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 66.6%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{a - z} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg66.6%

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*73.3%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out73.3%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative73.3%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub73.3%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out76.5%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg76.5%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/81.9%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified81.9%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in t around inf 72.1%

      \[\leadsto x + \frac{\color{blue}{t}}{\frac{a - z}{y - z}} \]

    if 5.49999999999999975e53 < y

    1. Initial program 76.3%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.0%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.0%

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      2. un-div-inv96.0%

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} \]
    6. Applied egg-rr96.0%

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} \]
    7. Taylor expanded in y around inf 91.5%

      \[\leadsto x + \frac{\color{blue}{y}}{\frac{a - z}{t - x}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 62.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+117}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.1e+117)
   (+ t (/ (* (- t x) a) z))
   (if (<= z 3.55e+143) (+ x (/ (- t x) (/ a y))) (+ t (* a (/ (- t x) z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.1e+117) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + ((t - x) / (a / y));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1.1d+117)) then
        tmp = t + (((t - x) * a) / z)
    else if (z <= 3.55d+143) then
        tmp = x + ((t - x) / (a / y))
    else
        tmp = t + (a * ((t - x) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.1e+117) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + ((t - x) / (a / y));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.1e+117:
		tmp = t + (((t - x) * a) / z)
	elif z <= 3.55e+143:
		tmp = x + ((t - x) / (a / y))
	else:
		tmp = t + (a * ((t - x) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.1e+117)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * a) / z));
	elseif (z <= 3.55e+143)
		tmp = Float64(x + Float64(Float64(t - x) / Float64(a / y)));
	else
		tmp = Float64(t + Float64(a * Float64(Float64(t - x) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.1e+117)
		tmp = t + (((t - x) * a) / z);
	elseif (z <= 3.55e+143)
		tmp = x + ((t - x) / (a / y));
	else
		tmp = t + (a * ((t - x) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+117], N[(t + N[(N[(N[(t - x), $MachinePrecision] * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.55e+143], N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+117}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\

\mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\
\;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\

\mathbf{else}:\\
\;\;\;\;t + a \cdot \frac{t - x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.10000000000000007e117

    1. Initial program 34.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative34.7%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative34.7%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*63.8%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define63.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified63.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 29.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg29.3%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*35.8%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out35.8%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative35.8%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative35.8%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define35.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified35.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 65.1%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]

    if -1.10000000000000007e117 < z < 3.55000000000000021e143

    1. Initial program 83.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*89.6%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified89.6%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 84.3%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{a - z} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg84.3%

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*84.1%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out84.1%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative84.1%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub84.1%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out89.6%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg89.6%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/92.5%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified92.5%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in z around 0 65.0%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{a}{y}}} \]

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative37.1%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*82.7%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define82.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 36.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg36.4%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*63.5%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out63.5%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative63.5%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative63.5%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define63.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 51.6%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*68.2%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+117}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 61.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+112}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1e+112)
   (+ t (/ (* (- t x) a) z))
   (if (<= z 3.55e+143) (+ x (* y (/ (- t x) a))) (+ t (* a (/ (- t x) z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+112) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + (y * ((t - x) / a));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1d+112)) then
        tmp = t + (((t - x) * a) / z)
    else if (z <= 3.55d+143) then
        tmp = x + (y * ((t - x) / a))
    else
        tmp = t + (a * ((t - x) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+112) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + (y * ((t - x) / a));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1e+112:
		tmp = t + (((t - x) * a) / z)
	elif z <= 3.55e+143:
		tmp = x + (y * ((t - x) / a))
	else:
		tmp = t + (a * ((t - x) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1e+112)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * a) / z));
	elseif (z <= 3.55e+143)
		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / a)));
	else
		tmp = Float64(t + Float64(a * Float64(Float64(t - x) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1e+112)
		tmp = t + (((t - x) * a) / z);
	elseif (z <= 3.55e+143)
		tmp = x + (y * ((t - x) / a));
	else
		tmp = t + (a * ((t - x) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+112], N[(t + N[(N[(N[(t - x), $MachinePrecision] * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.55e+143], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+112}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\

\mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

\mathbf{else}:\\
\;\;\;\;t + a \cdot \frac{t - x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.9999999999999993e111

    1. Initial program 34.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative34.7%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative34.7%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*63.8%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define63.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified63.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 29.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg29.3%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*35.8%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out35.8%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative35.8%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative35.8%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define35.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified35.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 65.1%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]

    if -9.9999999999999993e111 < z < 3.55000000000000021e143

    1. Initial program 83.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*89.6%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified89.6%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 57.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(t - x\right)}{a}} \]
    6. Step-by-step derivation
      1. associate-/l*64.4%

        \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    7. Simplified64.4%

      \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative37.1%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*82.7%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define82.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 36.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg36.4%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*63.5%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out63.5%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative63.5%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative63.5%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define63.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 51.6%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*68.2%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+112}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 59.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+130}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.5e+130)
   (+ t (/ (* (- t x) a) z))
   (if (<= z 3.55e+143) (+ x (* t (/ y (- a z)))) (+ t (* a (/ (- t x) z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.5e+130) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-4.5d+130)) then
        tmp = t + (((t - x) * a) / z)
    else if (z <= 3.55d+143) then
        tmp = x + (t * (y / (a - z)))
    else
        tmp = t + (a * ((t - x) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.5e+130) {
		tmp = t + (((t - x) * a) / z);
	} else if (z <= 3.55e+143) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = t + (a * ((t - x) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.5e+130:
		tmp = t + (((t - x) * a) / z)
	elif z <= 3.55e+143:
		tmp = x + (t * (y / (a - z)))
	else:
		tmp = t + (a * ((t - x) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.5e+130)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * a) / z));
	elseif (z <= 3.55e+143)
		tmp = Float64(x + Float64(t * Float64(y / Float64(a - z))));
	else
		tmp = Float64(t + Float64(a * Float64(Float64(t - x) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4.5e+130)
		tmp = t + (((t - x) * a) / z);
	elseif (z <= 3.55e+143)
		tmp = x + (t * (y / (a - z)));
	else
		tmp = t + (a * ((t - x) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+130], N[(t + N[(N[(N[(t - x), $MachinePrecision] * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.55e+143], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(a * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+130}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\

\mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\

\mathbf{else}:\\
\;\;\;\;t + a \cdot \frac{t - x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.50000000000000039e130

    1. Initial program 32.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative32.9%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative32.9%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*62.7%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define62.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified62.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 30.1%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg30.1%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*36.7%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out36.7%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative36.7%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative36.7%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define36.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified36.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 66.9%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]

    if -4.50000000000000039e130 < z < 3.55000000000000021e143

    1. Initial program 83.1%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 72.0%

      \[\leadsto x + \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
    4. Step-by-step derivation
      1. *-commutative72.0%

        \[\leadsto x + \frac{\color{blue}{\left(t - x\right) \cdot y}}{a - z} \]
    5. Simplified72.0%

      \[\leadsto x + \frac{\color{blue}{\left(t - x\right) \cdot y}}{a - z} \]
    6. Taylor expanded in t around inf 52.0%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a - z}} \]
    7. Step-by-step derivation
      1. associate-/l*57.6%

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a - z}} \]
    8. Simplified57.6%

      \[\leadsto x + \color{blue}{t \cdot \frac{y}{a - z}} \]

    if 3.55000000000000021e143 < z

    1. Initial program 37.1%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative37.1%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*82.7%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define82.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified82.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 36.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg36.4%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*63.5%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out63.5%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative63.5%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative63.5%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define63.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 51.6%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*68.2%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified68.2%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+130}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot a}{z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{+143}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 81.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+195}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.4e+195)
   (+ t (/ (* (- t x) (- a y)) z))
   (+ x (* (- y z) (/ (- t x) (- a z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.4e+195) {
		tmp = t + (((t - x) * (a - y)) / z);
	} else {
		tmp = x + ((y - z) * ((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 <= (-2.4d+195)) then
        tmp = t + (((t - x) * (a - y)) / z)
    else
        tmp = x + ((y - z) * ((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 <= -2.4e+195) {
		tmp = t + (((t - x) * (a - y)) / z);
	} else {
		tmp = x + ((y - z) * ((t - x) / (a - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.4e+195:
		tmp = t + (((t - x) * (a - y)) / z)
	else:
		tmp = x + ((y - z) * ((t - x) / (a - z)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.4e+195)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z));
	else
		tmp = Float64(x + Float64(Float64(y - z) * 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 <= -2.4e+195)
		tmp = t + (((t - x) * (a - y)) / z);
	else
		tmp = x + ((y - z) * ((t - x) / (a - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+195], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+195}:\\
\;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4000000000000003e195

    1. Initial program 24.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative24.7%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative24.7%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*51.7%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define51.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified51.9%

      \[\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 78.8%

      \[\leadsto \color{blue}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    6. Step-by-step derivation
      1. associate--l+78.8%

        \[\leadsto \color{blue}{t + \left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\right)} \]
      2. associate-*r/78.8%

        \[\leadsto t + \left(\color{blue}{\frac{-1 \cdot \left(y \cdot \left(t - x\right)\right)}{z}} - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\right) \]
      3. associate-*r/78.8%

        \[\leadsto t + \left(\frac{-1 \cdot \left(y \cdot \left(t - x\right)\right)}{z} - \color{blue}{\frac{-1 \cdot \left(a \cdot \left(t - x\right)\right)}{z}}\right) \]
      4. mul-1-neg78.8%

        \[\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-sub78.9%

        \[\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-neg78.9%

        \[\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--78.9%

        \[\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/78.9%

        \[\leadsto t + \color{blue}{-1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      9. mul-1-neg78.9%

        \[\leadsto t + \color{blue}{\left(-\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)} \]
      10. unsub-neg78.9%

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      11. distribute-rgt-out--78.9%

        \[\leadsto t - \frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z} \]
    7. Simplified78.9%

      \[\leadsto \color{blue}{t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}} \]

    if -2.4000000000000003e195 < z

    1. Initial program 74.8%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*87.1%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification86.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+195}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 49.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+95} \lor \neg \left(z \leq 2 \cdot 10^{+143}\right):\\ \;\;\;\;t + a \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -4e+95) (not (<= z 2e+143)))
   (+ t (* a (/ t z)))
   (* x (- 1.0 (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4e+95) || !(z <= 2e+143)) {
		tmp = t + (a * (t / z));
	} else {
		tmp = x * (1.0 - (y / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-4d+95)) .or. (.not. (z <= 2d+143))) then
        tmp = t + (a * (t / z))
    else
        tmp = x * (1.0d0 - (y / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4e+95) || !(z <= 2e+143)) {
		tmp = t + (a * (t / z));
	} else {
		tmp = x * (1.0 - (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -4e+95) or not (z <= 2e+143):
		tmp = t + (a * (t / z))
	else:
		tmp = x * (1.0 - (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -4e+95) || !(z <= 2e+143))
		tmp = Float64(t + Float64(a * Float64(t / z)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -4e+95) || ~((z <= 2e+143)))
		tmp = t + (a * (t / z));
	else
		tmp = x * (1.0 - (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+95], N[Not[LessEqual[z, 2e+143]], $MachinePrecision]], N[(t + N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+95} \lor \neg \left(z \leq 2 \cdot 10^{+143}\right):\\
\;\;\;\;t + a \cdot \frac{t}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.00000000000000008e95 or 2e143 < z

    1. Initial program 38.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative38.0%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative38.0%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*73.3%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define73.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified73.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 32.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg32.4%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*47.0%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out47.0%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative47.0%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative47.0%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define47.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified47.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 56.8%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*64.1%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified64.1%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    11. Taylor expanded in t around inf 52.7%

      \[\leadsto t + \color{blue}{\frac{a \cdot t}{z}} \]
    12. Step-by-step derivation
      1. associate-/l*60.8%

        \[\leadsto t + \color{blue}{a \cdot \frac{t}{z}} \]
    13. Simplified60.8%

      \[\leadsto t + \color{blue}{a \cdot \frac{t}{z}} \]

    if -4.00000000000000008e95 < z < 2e143

    1. Initial program 83.1%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*90.4%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified90.4%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 85.1%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{a - z} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg85.1%

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*84.8%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out84.8%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative84.8%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub84.8%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out90.4%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg90.4%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/92.8%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified92.8%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in t around inf 88.8%

      \[\leadsto x + \frac{\color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    9. Step-by-step derivation
      1. mul-1-neg88.8%

        \[\leadsto x + \frac{t \cdot \left(1 + \color{blue}{\left(-\frac{x}{t}\right)}\right)}{\frac{a - z}{y - z}} \]
      2. unsub-neg88.8%

        \[\leadsto x + \frac{t \cdot \color{blue}{\left(1 - \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    10. Simplified88.8%

      \[\leadsto x + \frac{\color{blue}{t \cdot \left(1 - \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    11. Taylor expanded in z around 0 61.1%

      \[\leadsto x + \frac{t \cdot \left(1 - \frac{x}{t}\right)}{\color{blue}{\frac{a}{y}}} \]
    12. Taylor expanded in x around inf 53.0%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{a}\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg53.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{a}\right)}\right) \]
      2. unsub-neg53.0%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{y}{a}\right)} \]
    14. Simplified53.0%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{a}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+95} \lor \neg \left(z \leq 2 \cdot 10^{+143}\right):\\ \;\;\;\;t + a \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 49.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+117}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+143}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.5e+117) t (if (<= z 2.4e+143) (* x (- 1.0 (/ y a))) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e+117) {
		tmp = t;
	} else if (z <= 2.4e+143) {
		tmp = x * (1.0 - (y / a));
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-5.5d+117)) then
        tmp = t
    else if (z <= 2.4d+143) then
        tmp = x * (1.0d0 - (y / a))
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e+117) {
		tmp = t;
	} else if (z <= 2.4e+143) {
		tmp = x * (1.0 - (y / a));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.5e+117:
		tmp = t
	elif z <= 2.4e+143:
		tmp = x * (1.0 - (y / a))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.5e+117)
		tmp = t;
	elseif (z <= 2.4e+143)
		tmp = Float64(x * Float64(1.0 - Float64(y / a)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.5e+117)
		tmp = t;
	elseif (z <= 2.4e+143)
		tmp = x * (1.0 - (y / a));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+117], t, If[LessEqual[z, 2.4e+143], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+117}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+143}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.49999999999999965e117 or 2.3999999999999998e143 < z

    1. Initial program 36.8%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative36.8%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative36.8%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*73.5%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define73.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified73.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 32.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg32.4%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*48.8%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out48.8%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative48.8%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative48.8%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define48.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified48.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in a around 0 61.3%

      \[\leadsto \color{blue}{t} \]

    if -5.49999999999999965e117 < z < 2.3999999999999998e143

    1. Initial program 82.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*89.5%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 84.8%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{a - z} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg84.8%

        \[\leadsto x + \left(\color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      2. associate-/l*84.0%

        \[\leadsto x + \left(\left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      3. distribute-lft-neg-out84.0%

        \[\leadsto x + \left(\color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} + y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)\right) \]
      4. +-commutative84.0%

        \[\leadsto x + \color{blue}{\left(y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) + \left(-z\right) \cdot \frac{t - x}{a - z}\right)} \]
      5. div-sub84.0%

        \[\leadsto x + \left(y \cdot \color{blue}{\frac{t - x}{a - z}} + \left(-z\right) \cdot \frac{t - x}{a - z}\right) \]
      6. distribute-rgt-out89.5%

        \[\leadsto x + \color{blue}{\frac{t - x}{a - z} \cdot \left(y + \left(-z\right)\right)} \]
      7. sub-neg89.5%

        \[\leadsto x + \frac{t - x}{a - z} \cdot \color{blue}{\left(y - z\right)} \]
      8. associate-/r/92.4%

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified92.4%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    8. Taylor expanded in t around inf 88.4%

      \[\leadsto x + \frac{\color{blue}{t \cdot \left(1 + -1 \cdot \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    9. Step-by-step derivation
      1. mul-1-neg88.4%

        \[\leadsto x + \frac{t \cdot \left(1 + \color{blue}{\left(-\frac{x}{t}\right)}\right)}{\frac{a - z}{y - z}} \]
      2. unsub-neg88.4%

        \[\leadsto x + \frac{t \cdot \color{blue}{\left(1 - \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    10. Simplified88.4%

      \[\leadsto x + \frac{\color{blue}{t \cdot \left(1 - \frac{x}{t}\right)}}{\frac{a - z}{y - z}} \]
    11. Taylor expanded in z around 0 60.7%

      \[\leadsto x + \frac{t \cdot \left(1 - \frac{x}{t}\right)}{\color{blue}{\frac{a}{y}}} \]
    12. Taylor expanded in x around inf 52.7%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{a}\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg52.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{a}\right)}\right) \]
      2. unsub-neg52.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{y}{a}\right)} \]
    14. Simplified52.7%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{a}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 22: 39.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+70}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-22}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.5e+70) t (if (<= z 2.05e-22) x t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.5e+70) {
		tmp = t;
	} else if (z <= 2.05e-22) {
		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 <= (-3.5d+70)) then
        tmp = t
    else if (z <= 2.05d-22) 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 <= -3.5e+70) {
		tmp = t;
	} else if (z <= 2.05e-22) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.5e+70:
		tmp = t
	elif z <= 2.05e-22:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.5e+70)
		tmp = t;
	elseif (z <= 2.05e-22)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.5e+70)
		tmp = t;
	elseif (z <= 2.05e-22)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+70], t, If[LessEqual[z, 2.05e-22], x, t]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+70}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{-22}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.50000000000000002e70 or 2.05e-22 < z

    1. Initial program 49.2%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative49.2%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative49.2%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*77.2%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define77.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified77.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 34.8%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg34.8%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*42.3%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out42.3%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative42.3%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative42.3%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define42.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified42.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in a around 0 46.6%

      \[\leadsto \color{blue}{t} \]

    if -3.50000000000000002e70 < z < 2.05e-22

    1. Initial program 85.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative85.0%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative85.0%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*93.9%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define93.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified93.9%

      \[\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 36.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 23: 25.0% accurate, 13.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
	return t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = t
end function
public static double code(double x, double y, double z, double t, double a) {
	return t;
}
def code(x, y, z, t, a):
	return t
function code(x, y, z, t, a)
	return t
end
function tmp = code(x, y, z, t, a)
	tmp = t;
end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 69.9%

    \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
  2. Step-by-step derivation
    1. +-commutative69.9%

      \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
    2. *-commutative69.9%

      \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
    3. associate-/l*86.8%

      \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
    4. fma-define86.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
  3. Simplified86.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 40.7%

    \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
  6. Step-by-step derivation
    1. mul-1-neg40.7%

      \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
    2. associate-/l*45.4%

      \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
    3. distribute-lft-neg-out45.4%

      \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
    4. +-commutative45.4%

      \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
    5. *-commutative45.4%

      \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
    6. fma-define45.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
  7. Simplified45.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
  8. Taylor expanded in a around 0 24.5%

    \[\leadsto \color{blue}{t} \]
  9. Add Preprocessing

Developer Target 1: 84.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* (/ y z) (- t x)))))
   (if (< z -1.2536131056095036e+188)
     t_1
     (if (< z 4.446702369113811e+64)
       (+ x (/ (- y z) (/ (- a z) (- t x))))
       t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - ((y / z) * (t - x));
	double tmp;
	if (z < -1.2536131056095036e+188) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t - ((y / z) * (t - x))
    if (z < (-1.2536131056095036d+188)) then
        tmp = t_1
    else if (z < 4.446702369113811d+64) then
        tmp = x + ((y - z) / ((a - z) / (t - x)))
    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 = t - ((y / z) * (t - x));
	double tmp;
	if (z < -1.2536131056095036e+188) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - ((y / z) * (t - x))
	tmp = 0
	if z < -1.2536131056095036e+188:
		tmp = t_1
	elif z < 4.446702369113811e+64:
		tmp = x + ((y - z) / ((a - z) / (t - x)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x)))
	tmp = 0.0
	if (z < -1.2536131056095036e+188)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - ((y / z) * (t - x));
	tmp = 0.0;
	if (z < -1.2536131056095036e+188)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024163 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))

  (+ x (/ (* (- y z) (- t x)) (- a z))))