Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.5% → 95.4%
Time: 16.3s
Alternatives: 21
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

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

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

Alternative 1: 95.4% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 86.7%

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt47.4%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y - z} \cdot \sqrt{y - z}}}{\frac{a - z}{t - x}} \]
      2. div-inv47.3%

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{\sqrt{y - z} \cdot \frac{\sqrt{y - z}}{a - z}}}{\frac{1}{t - x}} \]
      3. associate-*r/50.1%

        \[\leadsto x + \frac{\color{blue}{\frac{\sqrt{y - z} \cdot \sqrt{y - z}}{a - z}}}{\frac{1}{t - x}} \]
      4. rem-square-sqrt93.2%

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

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

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

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -4.7 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8e105 or 3.6999999999999999e157 < z

    1. Initial program 58.4%

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

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

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

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

      \[\leadsto \color{blue}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    6. Step-by-step derivation
      1. associate--l+70.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. distribute-lft-out--70.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e105 < z < -4.69999999999999998e-188 or 6.9999999999999997e-134 < z < 3.6999999999999999e157

    1. Initial program 87.1%

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

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

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

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

    if -4.69999999999999998e-188 < z < 6.9999999999999997e-134

    1. Initial program 92.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+105}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-134}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+157}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (* (- y a) (/ (- x t) z)))))
   (if (<= z -4.5e+43)
     t_1
     (if (<= z -8.6e-188)
       (- x (* t (/ (- z y) (- a z))))
       (if (<= z 1.6e+91) (+ x (/ (- y z) (/ a (- t x)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((y - a) * ((x - t) / z));
	double tmp;
	if (z <= -4.5e+43) {
		tmp = t_1;
	} else if (z <= -8.6e-188) {
		tmp = x - (t * ((z - y) / (a - z)));
	} else if (z <= 1.6e+91) {
		tmp = x + ((y - z) / (a / (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 - a) * ((x - t) / z))
    if (z <= (-4.5d+43)) then
        tmp = t_1
    else if (z <= (-8.6d-188)) then
        tmp = x - (t * ((z - y) / (a - z)))
    else if (z <= 1.6d+91) then
        tmp = x + ((y - z) / (a / (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 - a) * ((x - t) / z));
	double tmp;
	if (z <= -4.5e+43) {
		tmp = t_1;
	} else if (z <= -8.6e-188) {
		tmp = x - (t * ((z - y) / (a - z)));
	} else if (z <= 1.6e+91) {
		tmp = x + ((y - z) / (a / (t - x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + ((y - a) * ((x - t) / z))
	tmp = 0
	if z <= -4.5e+43:
		tmp = t_1
	elif z <= -8.6e-188:
		tmp = x - (t * ((z - y) / (a - z)))
	elif z <= 1.6e+91:
		tmp = x + ((y - z) / (a / (t - x)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(y - a) * Float64(Float64(x - t) / z)))
	tmp = 0.0
	if (z <= -4.5e+43)
		tmp = t_1;
	elseif (z <= -8.6e-188)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / Float64(a - z))));
	elseif (z <= 1.6e+91)
		tmp = Float64(x + Float64(Float64(y - z) / Float64(a / Float64(t - x))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + ((y - a) * ((x - t) / z));
	tmp = 0.0;
	if (z <= -4.5e+43)
		tmp = t_1;
	elseif (z <= -8.6e-188)
		tmp = x - (t * ((z - y) / (a - z)));
	elseif (z <= 1.6e+91)
		tmp = x + ((y - z) / (a / (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 - a), $MachinePrecision] * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+43], t$95$1, If[LessEqual[z, -8.6e-188], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+91], N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.5e43 or 1.59999999999999995e91 < z

    1. Initial program 65.3%

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

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

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

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

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

        \[\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. distribute-lft-out--68.2%

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

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

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

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

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

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

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

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

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

    if -4.5e43 < z < -8.59999999999999975e-188

    1. Initial program 83.8%

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

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

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

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

    if -8.59999999999999975e-188 < z < 1.59999999999999995e91

    1. Initial program 92.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+43}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x - t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ t (* (- y a) (/ x z)))))
   (if (<= z -2.7e+112)
     t_1
     (if (<= z -7.2e-188)
       (- x (* t (/ (- z y) (- a z))))
       (if (<= z 1.6e+91) (+ x (/ (- y z) (/ a (- t x)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t + ((y - a) * (x / z));
	double tmp;
	if (z <= -2.7e+112) {
		tmp = t_1;
	} else if (z <= -7.2e-188) {
		tmp = x - (t * ((z - y) / (a - z)));
	} else if (z <= 1.6e+91) {
		tmp = x + ((y - z) / (a / (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 - a) * (x / z))
    if (z <= (-2.7d+112)) then
        tmp = t_1
    else if (z <= (-7.2d-188)) then
        tmp = x - (t * ((z - y) / (a - z)))
    else if (z <= 1.6d+91) then
        tmp = x + ((y - z) / (a / (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 - a) * (x / z));
	double tmp;
	if (z <= -2.7e+112) {
		tmp = t_1;
	} else if (z <= -7.2e-188) {
		tmp = x - (t * ((z - y) / (a - z)));
	} else if (z <= 1.6e+91) {
		tmp = x + ((y - z) / (a / (t - x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t + ((y - a) * (x / z))
	tmp = 0
	if z <= -2.7e+112:
		tmp = t_1
	elif z <= -7.2e-188:
		tmp = x - (t * ((z - y) / (a - z)))
	elif z <= 1.6e+91:
		tmp = x + ((y - z) / (a / (t - x)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t + Float64(Float64(y - a) * Float64(x / z)))
	tmp = 0.0
	if (z <= -2.7e+112)
		tmp = t_1;
	elseif (z <= -7.2e-188)
		tmp = Float64(x - Float64(t * Float64(Float64(z - y) / Float64(a - z))));
	elseif (z <= 1.6e+91)
		tmp = Float64(x + Float64(Float64(y - z) / Float64(a / Float64(t - x))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t + ((y - a) * (x / z));
	tmp = 0.0;
	if (z <= -2.7e+112)
		tmp = t_1;
	elseif (z <= -7.2e-188)
		tmp = x - (t * ((z - y) / (a - z)));
	elseif (z <= 1.6e+91)
		tmp = x + ((y - z) / (a / (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 - a), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+112], t$95$1, If[LessEqual[z, -7.2e-188], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+91], N[(x + N[(N[(y - z), $MachinePrecision] / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7000000000000001e112 or 1.59999999999999995e91 < z

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e112 < z < -7.1999999999999994e-188

    1. Initial program 83.0%

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

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

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

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

    if -7.1999999999999994e-188 < z < 1.59999999999999995e91

    1. Initial program 92.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+112}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot \frac{z - y}{a - z}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+91}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+91}:\\
\;\;\;\;x - \frac{z \cdot t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.39999999999999992e38 or 4.39999999999999999e91 < z

    1. Initial program 65.3%

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

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

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

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

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

        \[\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. distribute-lft-out--68.2%

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

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

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

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

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

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

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

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

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

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

    if -5.39999999999999992e38 < z < 2.05e46

    1. Initial program 89.9%

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

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

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

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

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

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

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

    if 2.05e46 < z < 4.39999999999999999e91

    1. Initial program 90.2%

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot z}{a - z}} \]
      3. *-commutative90.2%

        \[\leadsto x - \frac{\color{blue}{z \cdot t}}{a - z} \]
    6. Simplified90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+38}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+46}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;x - \frac{z \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.0000000000000001e106 or 6.49999999999999996e52 < z

    1. Initial program 65.1%

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

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

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

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

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

    if -6.0000000000000001e106 < z < -8.1999999999999994e-6

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

    if -8.1999999999999994e-6 < z < 6.49999999999999996e52

    1. Initial program 90.6%

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

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

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

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

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

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

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

Alternative 7: 60.2% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.9999999999999994e104 or 6e52 < z

    1. Initial program 65.1%

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

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

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

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

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

    if -9.9999999999999994e104 < z < -2.60000000000000009e-6

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

    if -2.60000000000000009e-6 < z < 6e52

    1. Initial program 90.6%

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

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

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

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

Alternative 8: 60.1% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.55000000000000013e107 or 7.8000000000000002e49 < z

    1. Initial program 65.1%

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

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

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

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

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

    if -1.55000000000000013e107 < z < -8.99999999999999953e-9

    1. Initial program 81.1%

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

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

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

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

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

    if -8.99999999999999953e-9 < z < 7.8000000000000002e49

    1. Initial program 90.6%

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

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

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

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

Alternative 9: 86.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000009e106 < z < 3.3999999999999997e107

    1. Initial program 89.3%

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

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

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

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

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

Alternative 10: 86.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25e112 or 2.1000000000000001e109 < z

    1. Initial program 61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e112 < z < 2.1000000000000001e109

    1. Initial program 89.3%

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

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

Alternative 11: 51.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0000000000000003e54 or 3.69999999999999997e56 < z

    1. Initial program 67.5%

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

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

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

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

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

    if -4.0000000000000003e54 < z < -1.10000000000000006e-292

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000006e-292 < z < 3.69999999999999997e56

    1. Initial program 91.5%

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

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

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

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

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

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

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

Alternative 12: 68.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+43} \lor \neg \left(z \leq 1.2 \cdot 10^{+51}\right):\\
\;\;\;\;t - y \cdot \frac{t - x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.70000000000000006e43 or 1.1999999999999999e51 < z

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000006e43 < z < 1.1999999999999999e51

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

Alternative 13: 62.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.29999999999999999e53 or 6.1999999999999999e54 < z

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999999e53 < z < 6.1999999999999999e54

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

Alternative 14: 69.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000001e41 < z < 1.99999999999999989e49

    1. Initial program 90.0%

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

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

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

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

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

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

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

    if 1.99999999999999989e49 < z

    1. Initial program 64.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 72.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}} \]
    6. Step-by-step derivation
      1. associate--l+72.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. distribute-lft-out--72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 56.8% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1e108 or 1.05e95 < z

    1. Initial program 62.6%

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

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

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

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

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

    if -1e108 < z < 1.05e95

    1. Initial program 89.1%

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

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

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

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

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

Alternative 16: 49.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2e53 or 8.2000000000000002e50 < z

    1. Initial program 67.5%

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

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

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

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

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

    if -2e53 < z < 8.2000000000000002e50

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 37.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-19} \lor \neg \left(y \leq 8.2 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.1999999999999998e-19 or 8.2000000000000001e114 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999998e-19 < y < 8.2000000000000001e114

    1. Initial program 76.8%

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

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

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

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

Alternative 18: 38.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+52}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5500000000000001e53 or 3.4e52 < z

    1. Initial program 67.5%

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

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

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

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

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

    if -1.5500000000000001e53 < z < 3.4e52

    1. Initial program 89.4%

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

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

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

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

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

Alternative 19: 33.8% accurate, 4.3× speedup?

\[\begin{array}{l} \\ x + t \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
	return x + 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 = x + t
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + t;
}
def code(x, y, z, t, a):
	return x + t
function code(x, y, z, t, a)
	return Float64(x + t)
end
function tmp = code(x, y, z, t, a)
	tmp = x + t;
end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}

\\
x + t
\end{array}
Derivation
  1. Initial program 80.2%

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

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

    \[\leadsto x + \color{blue}{t} \]
  5. Add Preprocessing

Alternative 20: 25.2% accurate, 13.0× speedup?

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

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

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

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

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

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

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

Alternative 21: 2.8% accurate, 13.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
def code(x, y, z, t, a):
	return 0.0
function code(x, y, z, t, a)
	return 0.0
end
function tmp = code(x, y, z, t, a)
	tmp = 0.0;
end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x + -1 \cdot x} \]
  7. Step-by-step derivation
    1. distribute-rgt1-in2.9%

      \[\leadsto \color{blue}{\left(-1 + 1\right) \cdot x} \]
    2. metadata-eval2.9%

      \[\leadsto \color{blue}{0} \cdot x \]
    3. mul0-lft2.9%

      \[\leadsto \color{blue}{0} \]
  8. Simplified2.9%

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

Reproduce

?
herbie shell --seed 2024157 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))