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

Percentage Accurate: 68.4% → 88.8%
Time: 19.9s
Alternatives: 22
Speedup: 0.6×

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 22 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.4% 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: 88.8% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{z - y}{z - a}, x\right)\\

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


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

    1. Initial program 25.5%

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

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

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

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

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

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

      \[\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}} \]
    8. Step-by-step derivation
      1. associate--l+71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e142 < z < 2.8000000000000001e159

    1. Initial program 85.7%

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

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

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

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

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

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

    if 2.8000000000000001e159 < z

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

        \[\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-sub53.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-neg53.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--53.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/53.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.5% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -2.1 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -3.39999999999999977e127

    1. Initial program 76.8%

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

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

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

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

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

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

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

    if -3.39999999999999977e127 < a < -3.80000000000000009e60

    1. Initial program 93.3%

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

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

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

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

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

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

    if -3.80000000000000009e60 < a < -2.3999999999999999e-13 or 1.15e27 < a

    1. Initial program 65.4%

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

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

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

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

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

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

    if -2.3999999999999999e-13 < a < -2.1e-85 or 1.2499999999999999e-94 < a < 5e16

    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*77.3%

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

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

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

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

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

    if -2.1e-85 < a < 1.2499999999999999e-94

    1. Initial program 63.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac265.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y}{z}} \]
      8. /-rgt-identity89.0%

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

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

    if 5e16 < a < 1.15e27

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.4 \cdot 10^{+127}:\\ \;\;\;\;x + z \cdot \frac{t}{z - a}\\ \mathbf{elif}\;a \leq -3.8 \cdot 10^{+60}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-13}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -2.1 \cdot 10^{-85}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-94}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+27}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 68.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;a \leq -2.7 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -4.7 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -2.14999999999999992e127

    1. Initial program 76.8%

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

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

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

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

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

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

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

    if -2.14999999999999992e127 < a < -4.39999999999999992e60

    1. Initial program 93.3%

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

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

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

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

    if -4.39999999999999992e60 < a < -2.70000000000000011e-13 or 3.0500000000000001e25 < a

    1. Initial program 65.4%

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

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

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

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

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

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

    if -2.70000000000000011e-13 < a < -4.7000000000000001e-86 or 1.04e-94 < a < 5e16

    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*77.3%

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

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

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

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

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

    if -4.7000000000000001e-86 < a < 1.04e-94

    1. Initial program 63.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac265.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y}{z}} \]
      8. /-rgt-identity89.0%

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

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

    if 5e16 < a < 3.0500000000000001e25

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.15 \cdot 10^{+127}:\\ \;\;\;\;x + z \cdot \frac{t}{z - a}\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{+60}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\ \mathbf{elif}\;a \leq -2.7 \cdot 10^{-13}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -4.7 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 1.04 \cdot 10^{-94}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 3.05 \cdot 10^{+25}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+105}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x - t}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+53} \lor \neg \left(z \leq 1.5 \cdot 10^{+108}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{t}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (* (- t x) (/ (- a y) z)))))
   (if (<= z -4.6e+105)
     t_1
     (if (<= z -1.8e-27)
       (* t (/ (- z y) (- z a)))
       (if (<= z 1.25e-53)
         (- x (/ y (/ a (- x t))))
         (if (or (<= z 1.05e+53) (not (<= z 1.5e+108)))
           t_1
           (+ x (* z (/ t (- z a))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((t - x) * ((a - y) / z));
	double tmp;
	if (z <= -4.6e+105) {
		tmp = t_1;
	} else if (z <= -1.8e-27) {
		tmp = t * ((z - y) / (z - a));
	} else if (z <= 1.25e-53) {
		tmp = x - (y / (a / (x - t)));
	} else if ((z <= 1.05e+53) || !(z <= 1.5e+108)) {
		tmp = t_1;
	} else {
		tmp = x + (z * (t / (z - 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) :: t_1
    real(8) :: tmp
    t_1 = t + ((t - x) * ((a - y) / z))
    if (z <= (-4.6d+105)) then
        tmp = t_1
    else if (z <= (-1.8d-27)) then
        tmp = t * ((z - y) / (z - a))
    else if (z <= 1.25d-53) then
        tmp = x - (y / (a / (x - t)))
    else if ((z <= 1.05d+53) .or. (.not. (z <= 1.5d+108))) then
        tmp = t_1
    else
        tmp = x + (z * (t / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((t - x) * ((a - y) / z));
	double tmp;
	if (z <= -4.6e+105) {
		tmp = t_1;
	} else if (z <= -1.8e-27) {
		tmp = t * ((z - y) / (z - a));
	} else if (z <= 1.25e-53) {
		tmp = x - (y / (a / (x - t)));
	} else if ((z <= 1.05e+53) || !(z <= 1.5e+108)) {
		tmp = t_1;
	} else {
		tmp = x + (z * (t / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + ((t - x) * ((a - y) / z))
	tmp = 0
	if z <= -4.6e+105:
		tmp = t_1
	elif z <= -1.8e-27:
		tmp = t * ((z - y) / (z - a))
	elif z <= 1.25e-53:
		tmp = x - (y / (a / (x - t)))
	elif (z <= 1.05e+53) or not (z <= 1.5e+108):
		tmp = t_1
	else:
		tmp = x + (z * (t / (z - a)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(t - x) * Float64(Float64(a - y) / z)))
	tmp = 0.0
	if (z <= -4.6e+105)
		tmp = t_1;
	elseif (z <= -1.8e-27)
		tmp = Float64(t * Float64(Float64(z - y) / Float64(z - a)));
	elseif (z <= 1.25e-53)
		tmp = Float64(x - Float64(y / Float64(a / Float64(x - t))));
	elseif ((z <= 1.05e+53) || !(z <= 1.5e+108))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(z * Float64(t / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + ((t - x) * ((a - y) / z));
	tmp = 0.0;
	if (z <= -4.6e+105)
		tmp = t_1;
	elseif (z <= -1.8e-27)
		tmp = t * ((z - y) / (z - a));
	elseif (z <= 1.25e-53)
		tmp = x - (y / (a / (x - t)));
	elseif ((z <= 1.05e+53) || ~((z <= 1.5e+108)))
		tmp = t_1;
	else
		tmp = x + (z * (t / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t + N[(N[(t - x), $MachinePrecision] * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+105], t$95$1, If[LessEqual[z, -1.8e-27], N[(t * N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-53], N[(x - N[(y / N[(a / N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.05e+53], N[Not[LessEqual[z, 1.5e+108]], $MachinePrecision]], t$95$1, N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+53} \lor \neg \left(z \leq 1.5 \cdot 10^{+108}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5999999999999996e105 or 1.25e-53 < z < 1.0500000000000001e53 or 1.49999999999999992e108 < z

    1. Initial program 40.0%

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

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

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

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

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

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

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

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

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

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

        \[\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-sub63.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-neg63.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--63.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/63.9%

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

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

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

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

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

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

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

    if -4.5999999999999996e105 < z < -1.7999999999999999e-27

    1. Initial program 78.8%

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

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

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

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

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

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

    if -1.7999999999999999e-27 < z < 1.25e-53

    1. Initial program 92.9%

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

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{t - x}{a}} \]
    8. Step-by-step derivation
      1. clear-num78.7%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t - x}}} \]
      2. un-div-inv79.5%

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

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

    if 1.0500000000000001e53 < z < 1.49999999999999992e108

    1. Initial program 91.1%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{z \cdot \frac{t - x}{a - z}} \]
    7. Simplified81.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+105}:\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-27}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x - t}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+53} \lor \neg \left(z \leq 1.5 \cdot 10^{+108}\right):\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{t}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.8% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+53} \lor \neg \left(z \leq 1.25 \cdot 10^{+108}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.0199999999999999e84 or 6.99999999999999987e-53 < z < 1.0500000000000001e53 or 1.24999999999999998e108 < z

    1. Initial program 42.9%

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} \]
    7. Taylor expanded in z around inf 62.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}} \]
    8. Step-by-step derivation
      1. associate--l+62.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/62.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/62.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-neg62.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-sub62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.0199999999999999e84 < z < -6.80000000000000026e-26

    1. Initial program 75.7%

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

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

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

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

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

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

    if -6.80000000000000026e-26 < z < 6.99999999999999987e-53

    1. Initial program 92.9%

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

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{t - x}{a}} \]
    8. Step-by-step derivation
      1. clear-num78.7%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t - x}}} \]
      2. un-div-inv79.5%

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

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

    if 1.0500000000000001e53 < z < 1.24999999999999998e108

    1. Initial program 91.1%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{z \cdot \frac{t - x}{a - z}} \]
    7. Simplified81.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+84}:\\ \;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-26}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x - t}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+53} \lor \neg \left(z \leq 1.25 \cdot 10^{+108}\right):\\ \;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{t}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -5.1 \cdot 10^{-85}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.49999999999999953e-11 or 3.0500000000000001e25 < a

    1. Initial program 72.2%

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

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

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

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

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

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

    if -6.49999999999999953e-11 < a < -5.1000000000000002e-85 or 6.09999999999999992e-94 < a < 5e16

    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*77.3%

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

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

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

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

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

    if -5.1000000000000002e-85 < a < 6.09999999999999992e-94

    1. Initial program 63.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac265.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y}{z}} \]
      8. /-rgt-identity89.0%

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

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

    if 5e16 < a < 3.0500000000000001e25

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{-11}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -5.1 \cdot 10^{-85}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 6.1 \cdot 10^{-94}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;a \leq 3.05 \cdot 10^{+25}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 86.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -2.25 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 25.5%

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

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

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

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

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

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

      \[\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}} \]
    8. Step-by-step derivation
      1. associate--l+71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.20000000000000005e142 < z < -2.2499999999999999e-144 or 8.20000000000000044e-225 < z < 8.2000000000000002e161

    1. Initial program 80.0%

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

    if -2.2499999999999999e-144 < z < 8.20000000000000044e-225

    1. Initial program 99.4%

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

    if 8.2000000000000002e161 < z

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

        \[\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-sub53.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-neg53.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--53.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/53.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+142}:\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{-144}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-225}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(x - t\right)}{z - a}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+161}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{x - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 86.5% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 25.5%

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

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

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

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

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

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

      \[\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}} \]
    8. Step-by-step derivation
      1. associate--l+71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4999999999999999e142 < z < -2.4999999999999999e-145

    1. Initial program 74.5%

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

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

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

    if -2.4999999999999999e-145 < z < 5.00000000000000024e-223

    1. Initial program 99.4%

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

    if 5.00000000000000024e-223 < z < 9.79999999999999938e166

    1. Initial program 84.8%

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

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

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

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

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

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

    if 9.79999999999999938e166 < z

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

        \[\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-sub53.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-neg53.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--53.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/53.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+142}:\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-145}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-223}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot \left(x - t\right)}{z - a}\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+166}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{t - x}{\frac{z}{a - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -1.5 \cdot 10^{-200}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-139}:\\
\;\;\;\;x - x \cdot \frac{y}{a}\\

\mathbf{elif}\;t \leq 16500:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.44999999999999999e-140 or 16500 < t

    1. Initial program 74.0%

      \[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 x around 0 60.4%

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

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

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

    if -1.44999999999999999e-140 < t < -1.49999999999999997e-200 or 4.00000000000000012e-139 < t < 16500

    1. Initial program 61.9%

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

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

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

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

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

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

    if -1.49999999999999997e-200 < t < 4.00000000000000012e-139

    1. Initial program 61.8%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg53.0%

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

        \[\leadsto x + \left(-\color{blue}{x \cdot \frac{y}{a}}\right) \]
      3. distribute-rgt-neg-in64.0%

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

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

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

        \[\leadsto x + x \cdot \frac{\color{blue}{-y}}{a} \]
    10. Simplified64.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.45 \cdot 10^{-140}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-200}:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-139}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 16500:\\ \;\;\;\;y \cdot \frac{x - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z - y}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 52.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -33000:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-26} \lor \neg \left(z \leq 8 \cdot 10^{+90}\right):\\
\;\;\;\;t + a \cdot \frac{t}{z}\\

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


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

    1. Initial program 33.8%

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

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

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

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

    if -6.99999999999999974e69 < z < -33000

    1. Initial program 90.4%

      \[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 x around 0 79.5%

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

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

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

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

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

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

    if -33000 < z < -1.90000000000000007e-26 or 7.99999999999999973e90 < z

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
      3. distribute-lft-neg-in56.0%

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

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

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

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

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

    if -1.90000000000000007e-26 < z < 7.99999999999999973e90

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 35.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -4900000:\\
\;\;\;\;t \cdot \frac{y}{-z}\\

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-42}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+90}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8000000000000001e69 or -4.9e6 < z < -1.3e-42 or 6.19999999999999977e90 < z

    1. Initial program 42.2%

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

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

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

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

    if -1.8000000000000001e69 < z < -4.9e6

    1. Initial program 90.4%

      \[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 x around 0 79.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    12. Step-by-step derivation
      1. mul-1-neg47.3%

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z}} \]
      3. distribute-lft-neg-in56.7%

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

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

    if -1.3e-42 < z < 2.45000000000000007e-85

    1. Initial program 92.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 x around 0 52.0%

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. associate-*r/40.4%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    10. Simplified40.4%

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

    if 2.45000000000000007e-85 < z < 6.19999999999999977e90

    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.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4900000:\\ \;\;\;\;t \cdot \frac{y}{-z}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-42}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{-85}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+90}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 63.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{z - y}{z - a}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.60000000000000004e-135 or 17000 < t

    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*90.0%

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

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

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

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

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

    if -2.60000000000000004e-135 < t < -3.40000000000000006e-199

    1. Initial program 60.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac226.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y}{z}} \]
      8. /-rgt-identity71.4%

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

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

    if -3.40000000000000006e-199 < t < 17000

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

Alternative 13: 86.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 25.5%

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

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

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

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

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

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

      \[\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}} \]
    8. Step-by-step derivation
      1. associate--l+71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999993e142 < z < 2.75000000000000007e163

    1. Initial program 85.7%

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

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

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

    if 2.75000000000000007e163 < z

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

        \[\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-sub53.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-neg53.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--53.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/53.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-199} \lor \neg \left(t \leq 3.5 \cdot 10^{-10}\right):\\
\;\;\;\;t \cdot \frac{z - y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.49999999999999992e-199 or 3.4999999999999998e-10 < t

    1. Initial program 72.1%

      \[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 x around 0 57.6%

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

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

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

    if -1.49999999999999992e-199 < t < 3.4999999999999998e-10

    1. Initial program 63.1%

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    7. Simplified58.1%

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg46.7%

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

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

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

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

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

        \[\leadsto x + x \cdot \frac{\color{blue}{-y}}{a} \]
    10. Simplified56.4%

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

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

Alternative 15: 64.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-11} \lor \neg \left(a \leq 1.25 \cdot 10^{-12}\right):\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.8e-11 or 1.24999999999999992e-12 < a

    1. Initial program 71.4%

      \[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 z around 0 58.5%

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

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

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

    if -5.8e-11 < a < 1.24999999999999992e-12

    1. Initial program 67.4%

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

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

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

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

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

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

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

Alternative 16: 55.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8e13 or 5.99999999999999957e90 < z

    1. Initial program 39.0%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
      3. distribute-lft-neg-in57.0%

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. *-rgt-identity34.1%

        \[\leadsto -\frac{t \cdot z}{\color{blue}{\left(a - z\right) \cdot 1}} \]
      3. times-frac48.5%

        \[\leadsto -\color{blue}{\frac{t}{a - z} \cdot \frac{z}{1}} \]
      4. /-rgt-identity48.5%

        \[\leadsto -\frac{t}{a - z} \cdot \color{blue}{z} \]
      5. associate-/r/57.0%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a - z}{z}}} \]
      6. div-sub57.0%

        \[\leadsto -\frac{t}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      7. sub-neg57.0%

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

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

        \[\leadsto -\frac{t}{\frac{a}{z} + \color{blue}{-1}} \]
    13. Simplified57.0%

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

    if -5.8e13 < z < 5.99999999999999957e90

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 37.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.20000000000000036e71 or 2.3999999999999999e129 < z

    1. Initial program 31.9%

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

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

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

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

    if -6.20000000000000036e71 < z < 2.3999999999999999e129

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

Alternative 18: 37.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 33.8%

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

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

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

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

    if -6.79999999999999973e69 < z < 2.90000000000000003e129

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

    if 2.90000000000000003e129 < z

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
      3. distribute-lft-neg-in56.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+129}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + a \cdot \frac{t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 54.6% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.60000000000000011e-16

    1. Initial program 80.5%

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

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

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

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

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

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

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

    if -1.60000000000000011e-16 < a < 2.3e14

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y - z}{z}} \]
      3. distribute-lft-neg-in63.7%

        \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{y - z}{z}} \]
      4. div-sub63.7%

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

        \[\leadsto \left(-t\right) \cdot \color{blue}{\left(\frac{y}{z} + \left(-\frac{z}{z}\right)\right)} \]
      6. *-inverses63.7%

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

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

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

    if 2.3e14 < a

    1. Initial program 63.8%

      \[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 z around 0 51.5%

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

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

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

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

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

Alternative 20: 36.2% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+90}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.14999999999999999e-44 or 5.99999999999999957e90 < z

    1. Initial program 45.8%

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

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

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

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

    if -1.14999999999999999e-44 < z < 2.94999999999999999e-86

    1. Initial program 92.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 x around 0 52.0%

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. associate-*r/40.4%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    10. Simplified40.4%

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

    if 2.94999999999999999e-86 < z < 5.99999999999999957e90

    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.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{-44}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-86}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+90}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 38.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.8000000000000002e-12 or 5e16 < a

    1. Initial program 72.1%

      \[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 a around inf 37.7%

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

    if -2.8000000000000002e-12 < a < 5e16

    1. Initial program 67.0%

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

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

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

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

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

Alternative 22: 24.5% 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.3%

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

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

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

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

    \[\leadsto t \]
  7. Add Preprocessing

Developer target: 83.3% 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 2024071 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :alt
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

  (+ x (/ (* (- y z) (- t x)) (- a z))))