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

Percentage Accurate: 68.3% → 90.3%
Time: 17.6s
Alternatives: 19
Speedup: 0.6×

Specification

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

\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\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 19 alternatives:

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

Initial Program: 68.3% accurate, 1.0× speedup?

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

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

Alternative 1: 90.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 69.6%

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

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

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

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

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

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

    1. Initial program 9.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr9.5%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 86.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(z - a\right) \cdot \frac{x - y}{t}\\ t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;y - \frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+295}:\\ \;\;\;\;x + \frac{-1}{\frac{a - t}{\left(y - x\right) \cdot \left(t - z\right)}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ y (* (- z a) (/ (- x y) t))))
        (t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e-260)
       t_2
       (if (<= t_2 0.0)
         (- y (/ (* (- y x) (- z a)) t))
         (if (<= t_2 4e+295)
           (+ x (/ -1.0 (/ (- a t) (* (- y x) (- t z)))))
           t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y + ((z - a) * ((x - y) / t));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_2 <= 4e+295) {
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y + ((z - a) * ((x - y) / t));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -5e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_2 <= 4e+295) {
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y + ((z - a) * ((x - y) / t))
	t_2 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -5e-260:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = y - (((y - x) * (z - a)) / t)
	elif t_2 <= 4e+295:
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y + Float64(Float64(z - a) * Float64(Float64(x - y) / t)))
	t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(y - Float64(Float64(Float64(y - x) * Float64(z - a)) / t));
	elseif (t_2 <= 4e+295)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(a - t) / Float64(Float64(y - x) * Float64(t - z)))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y + ((z - a) * ((x - y) / t));
	t_2 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -5e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = y - (((y - x) * (z - a)) / t);
	elseif (t_2 <= 4e+295)
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(N[(z - a), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-260], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y - N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+295], N[(x + N[(-1.0 / N[(N[(a - t), $MachinePrecision] / N[(N[(y - x), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 3.9999999999999999e295 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000003e-260

    1. Initial program 95.9%

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

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

    1. Initial program 9.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr9.5%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.4%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}} \]
      2. associate-/l/94.4%

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

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

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

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

Alternative 3: 86.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + x \cdot \left(\frac{z - t}{a - t} \cdot \left(-1 + \frac{y}{x}\right)\right)\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-260}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;y - \frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+295}:\\ \;\;\;\;x + \frac{-1}{\frac{a - t}{\left(y - x\right) \cdot \left(t - z\right)}}\\ \mathbf{else}:\\ \;\;\;\;y + \left(z - a\right) \cdot \frac{x - y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_1 (- INFINITY))
     (+ x (* x (* (/ (- z t) (- a t)) (+ -1.0 (/ y x)))))
     (if (<= t_1 -5e-260)
       t_1
       (if (<= t_1 0.0)
         (- y (/ (* (- y x) (- z a)) t))
         (if (<= t_1 4e+295)
           (+ x (/ -1.0 (/ (- a t) (* (- y x) (- t z)))))
           (+ y (* (- z a) (/ (- x y) t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + (x * (((z - t) / (a - t)) * (-1.0 + (y / x))));
	} else if (t_1 <= -5e-260) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_1 <= 4e+295) {
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	} else {
		tmp = y + ((z - a) * ((x - y) / t));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + (x * (((z - t) / (a - t)) * (-1.0 + (y / x))));
	} else if (t_1 <= -5e-260) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_1 <= 4e+295) {
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	} else {
		tmp = y + ((z - a) * ((x - y) / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + (x * (((z - t) / (a - t)) * (-1.0 + (y / x))))
	elif t_1 <= -5e-260:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = y - (((y - x) * (z - a)) / t)
	elif t_1 <= 4e+295:
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))))
	else:
		tmp = y + ((z - a) * ((x - y) / t))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(x * Float64(Float64(Float64(z - t) / Float64(a - t)) * Float64(-1.0 + Float64(y / x)))));
	elseif (t_1 <= -5e-260)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(y - Float64(Float64(Float64(y - x) * Float64(z - a)) / t));
	elseif (t_1 <= 4e+295)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(a - t) / Float64(Float64(y - x) * Float64(t - z)))));
	else
		tmp = Float64(y + Float64(Float64(z - a) * Float64(Float64(x - y) / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + (x * (((z - t) / (a - t)) * (-1.0 + (y / x))));
	elseif (t_1 <= -5e-260)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = y - (((y - x) * (z - a)) / t);
	elseif (t_1 <= 4e+295)
		tmp = x + (-1.0 / ((a - t) / ((y - x) * (t - z))));
	else
		tmp = y + ((z - a) * ((x - y) / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(x * N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-260], t$95$1, If[LessEqual[t$95$1, 0.0], N[(y - N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+295], N[(x + N[(-1.0 / N[(N[(a - t), $MachinePrecision] / N[(N[(y - x), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[(z - a), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+295}:\\
\;\;\;\;x + \frac{-1}{\frac{a - t}{\left(y - x\right) \cdot \left(t - z\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0

    1. Initial program 37.7%

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000003e-260

    1. Initial program 95.9%

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

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

    1. Initial program 9.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr9.5%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.4%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y - x}}} \]
      2. associate-/l/94.4%

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

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

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

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

    1. Initial program 37.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(z - a\right) \cdot \frac{x - y}{t}\\ t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;y - \frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+295}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ y (* (- z a) (/ (- x y) t))))
        (t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e-260)
       t_2
       (if (<= t_2 0.0)
         (- y (/ (* (- y x) (- z a)) t))
         (if (<= t_2 4e+295) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y + ((z - a) * ((x - y) / t));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_2 <= 4e+295) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y + ((z - a) * ((x - y) / t));
	double t_2 = x + (((y - x) * (z - t)) / (a - t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -5e-260) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y - (((y - x) * (z - a)) / t);
	} else if (t_2 <= 4e+295) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y + ((z - a) * ((x - y) / t))
	t_2 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -5e-260:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = y - (((y - x) * (z - a)) / t)
	elif t_2 <= 4e+295:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y + Float64(Float64(z - a) * Float64(Float64(x - y) / t)))
	t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(y - Float64(Float64(Float64(y - x) * Float64(z - a)) / t));
	elseif (t_2 <= 4e+295)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y + ((z - a) * ((x - y) / t));
	t_2 = x + (((y - x) * (z - t)) / (a - t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -5e-260)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = y - (((y - x) * (z - a)) / t);
	elseif (t_2 <= 4e+295)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y + N[(N[(z - a), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-260], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y - N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+295], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -inf.0 or 3.9999999999999999e295 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000003e-260 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 3.9999999999999999e295

    1. Initial program 95.0%

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

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

    1. Initial program 9.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr9.5%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-19.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 49.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - t \cdot \frac{y}{a}\\ \mathbf{if}\;t \leq -2.3 \cdot 10^{+153}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -8.6 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{+51}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -1.6 \cdot 10^{-187}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-299}:\\ \;\;\;\;z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 1.66 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* t (/ y a)))))
   (if (<= t -2.3e+153)
     y
     (if (<= t -8.6e+53)
       t_1
       (if (<= t -2.95e+51)
         (+ x y)
         (if (<= t -1.6e-187)
           (+ x (* y (/ z a)))
           (if (<= t -1.22e-299)
             (* z (/ (- y x) a))
             (if (<= t 1.66e+24)
               (* x (- 1.0 (/ z a)))
               (if (<= t 7.5e+113) t_1 y)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t * (y / a));
	double tmp;
	if (t <= -2.3e+153) {
		tmp = y;
	} else if (t <= -8.6e+53) {
		tmp = t_1;
	} else if (t <= -2.95e+51) {
		tmp = x + y;
	} else if (t <= -1.6e-187) {
		tmp = x + (y * (z / a));
	} else if (t <= -1.22e-299) {
		tmp = z * ((y - x) / a);
	} else if (t <= 1.66e+24) {
		tmp = x * (1.0 - (z / a));
	} else if (t <= 7.5e+113) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (t * (y / a))
    if (t <= (-2.3d+153)) then
        tmp = y
    else if (t <= (-8.6d+53)) then
        tmp = t_1
    else if (t <= (-2.95d+51)) then
        tmp = x + y
    else if (t <= (-1.6d-187)) then
        tmp = x + (y * (z / a))
    else if (t <= (-1.22d-299)) then
        tmp = z * ((y - x) / a)
    else if (t <= 1.66d+24) then
        tmp = x * (1.0d0 - (z / a))
    else if (t <= 7.5d+113) then
        tmp = t_1
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (t * (y / a));
	double tmp;
	if (t <= -2.3e+153) {
		tmp = y;
	} else if (t <= -8.6e+53) {
		tmp = t_1;
	} else if (t <= -2.95e+51) {
		tmp = x + y;
	} else if (t <= -1.6e-187) {
		tmp = x + (y * (z / a));
	} else if (t <= -1.22e-299) {
		tmp = z * ((y - x) / a);
	} else if (t <= 1.66e+24) {
		tmp = x * (1.0 - (z / a));
	} else if (t <= 7.5e+113) {
		tmp = t_1;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (t * (y / a))
	tmp = 0
	if t <= -2.3e+153:
		tmp = y
	elif t <= -8.6e+53:
		tmp = t_1
	elif t <= -2.95e+51:
		tmp = x + y
	elif t <= -1.6e-187:
		tmp = x + (y * (z / a))
	elif t <= -1.22e-299:
		tmp = z * ((y - x) / a)
	elif t <= 1.66e+24:
		tmp = x * (1.0 - (z / a))
	elif t <= 7.5e+113:
		tmp = t_1
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(t * Float64(y / a)))
	tmp = 0.0
	if (t <= -2.3e+153)
		tmp = y;
	elseif (t <= -8.6e+53)
		tmp = t_1;
	elseif (t <= -2.95e+51)
		tmp = Float64(x + y);
	elseif (t <= -1.6e-187)
		tmp = Float64(x + Float64(y * Float64(z / a)));
	elseif (t <= -1.22e-299)
		tmp = Float64(z * Float64(Float64(y - x) / a));
	elseif (t <= 1.66e+24)
		tmp = Float64(x * Float64(1.0 - Float64(z / a)));
	elseif (t <= 7.5e+113)
		tmp = t_1;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (t * (y / a));
	tmp = 0.0;
	if (t <= -2.3e+153)
		tmp = y;
	elseif (t <= -8.6e+53)
		tmp = t_1;
	elseif (t <= -2.95e+51)
		tmp = x + y;
	elseif (t <= -1.6e-187)
		tmp = x + (y * (z / a));
	elseif (t <= -1.22e-299)
		tmp = z * ((y - x) / a);
	elseif (t <= 1.66e+24)
		tmp = x * (1.0 - (z / a));
	elseif (t <= 7.5e+113)
		tmp = t_1;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+153], y, If[LessEqual[t, -8.6e+53], t$95$1, If[LessEqual[t, -2.95e+51], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.6e-187], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.22e-299], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.66e+24], N[(x * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+113], t$95$1, y]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -8.6 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -2.95 \cdot 10^{+51}:\\
\;\;\;\;x + y\\

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

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

\mathbf{elif}\;t \leq 1.66 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -2.3000000000000001e153 or 7.5000000000000001e113 < t

    1. Initial program 34.8%

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

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

    if -2.3000000000000001e153 < t < -8.5999999999999995e53 or 1.65999999999999991e24 < t < 7.5000000000000001e113

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a}} \]
      3. associate-/l*49.7%

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

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

    if -8.5999999999999995e53 < t < -2.94999999999999991e51

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot y} \]
    10. Step-by-step derivation
      1. sub-neg54.7%

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

        \[\leadsto x + \left(-\color{blue}{\left(-y\right)}\right) \]
      3. remove-double-neg54.7%

        \[\leadsto x + \color{blue}{y} \]
      4. +-commutative54.7%

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified54.7%

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

    if -2.94999999999999991e51 < t < -1.5999999999999999e-187

    1. Initial program 83.0%

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

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

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

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

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

    if -1.5999999999999999e-187 < t < -1.22e-299

    1. Initial program 91.4%

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

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

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

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

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

    if -1.22e-299 < t < 1.65999999999999991e24

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.3 \cdot 10^{+153}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -8.6 \cdot 10^{+53}:\\ \;\;\;\;x - t \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{+51}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -1.6 \cdot 10^{-187}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-299}:\\ \;\;\;\;z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 1.66 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+113}:\\ \;\;\;\;x - t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \frac{y - x}{a}\\ t_2 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -2.8 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-90}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-54}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 15000:\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* z (/ (- y x) a)))) (t_2 (* y (/ (- z t) (- a t)))))
   (if (<= t -2.8e+39)
     t_2
     (if (<= t 1.95e-90)
       t_1
       (if (<= t 1.3e-54)
         t_2
         (if (<= t 1.22e-27)
           t_1
           (if (<= t 15000.0)
             (* z (/ (- y x) (- a t)))
             (if (<= t 3.6e+26) (* x (- 1.0 (/ z a))) t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (z * ((y - x) / a));
	double t_2 = y * ((z - t) / (a - t));
	double tmp;
	if (t <= -2.8e+39) {
		tmp = t_2;
	} else if (t <= 1.95e-90) {
		tmp = t_1;
	} else if (t <= 1.3e-54) {
		tmp = t_2;
	} else if (t <= 1.22e-27) {
		tmp = t_1;
	} else if (t <= 15000.0) {
		tmp = z * ((y - x) / (a - t));
	} else if (t <= 3.6e+26) {
		tmp = x * (1.0 - (z / a));
	} 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 + (z * ((y - x) / a))
    t_2 = y * ((z - t) / (a - t))
    if (t <= (-2.8d+39)) then
        tmp = t_2
    else if (t <= 1.95d-90) then
        tmp = t_1
    else if (t <= 1.3d-54) then
        tmp = t_2
    else if (t <= 1.22d-27) then
        tmp = t_1
    else if (t <= 15000.0d0) then
        tmp = z * ((y - x) / (a - t))
    else if (t <= 3.6d+26) then
        tmp = x * (1.0d0 - (z / a))
    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 + (z * ((y - x) / a));
	double t_2 = y * ((z - t) / (a - t));
	double tmp;
	if (t <= -2.8e+39) {
		tmp = t_2;
	} else if (t <= 1.95e-90) {
		tmp = t_1;
	} else if (t <= 1.3e-54) {
		tmp = t_2;
	} else if (t <= 1.22e-27) {
		tmp = t_1;
	} else if (t <= 15000.0) {
		tmp = z * ((y - x) / (a - t));
	} else if (t <= 3.6e+26) {
		tmp = x * (1.0 - (z / a));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (z * ((y - x) / a))
	t_2 = y * ((z - t) / (a - t))
	tmp = 0
	if t <= -2.8e+39:
		tmp = t_2
	elif t <= 1.95e-90:
		tmp = t_1
	elif t <= 1.3e-54:
		tmp = t_2
	elif t <= 1.22e-27:
		tmp = t_1
	elif t <= 15000.0:
		tmp = z * ((y - x) / (a - t))
	elif t <= 3.6e+26:
		tmp = x * (1.0 - (z / a))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(z * Float64(Float64(y - x) / a)))
	t_2 = Float64(y * Float64(Float64(z - t) / Float64(a - t)))
	tmp = 0.0
	if (t <= -2.8e+39)
		tmp = t_2;
	elseif (t <= 1.95e-90)
		tmp = t_1;
	elseif (t <= 1.3e-54)
		tmp = t_2;
	elseif (t <= 1.22e-27)
		tmp = t_1;
	elseif (t <= 15000.0)
		tmp = Float64(z * Float64(Float64(y - x) / Float64(a - t)));
	elseif (t <= 3.6e+26)
		tmp = Float64(x * Float64(1.0 - Float64(z / a)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (z * ((y - x) / a));
	t_2 = y * ((z - t) / (a - t));
	tmp = 0.0;
	if (t <= -2.8e+39)
		tmp = t_2;
	elseif (t <= 1.95e-90)
		tmp = t_1;
	elseif (t <= 1.3e-54)
		tmp = t_2;
	elseif (t <= 1.22e-27)
		tmp = t_1;
	elseif (t <= 15000.0)
		tmp = z * ((y - x) / (a - t));
	elseif (t <= 3.6e+26)
		tmp = x * (1.0 - (z / a));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+39], t$95$2, If[LessEqual[t, 1.95e-90], t$95$1, If[LessEqual[t, 1.3e-54], t$95$2, If[LessEqual[t, 1.22e-27], t$95$1, If[LessEqual[t, 15000.0], N[(z * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+26], N[(x * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1.95 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 1.22 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 3.6 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.80000000000000001e39 or 1.95000000000000002e-90 < t < 1.30000000000000001e-54 or 3.60000000000000024e26 < t

    1. Initial program 44.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr77.7%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-177.7%

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

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

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

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

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

    if -2.80000000000000001e39 < t < 1.95000000000000002e-90 or 1.30000000000000001e-54 < t < 1.22e-27

    1. Initial program 90.9%

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

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

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

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

    if 1.22e-27 < t < 15000

    1. Initial program 79.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num79.6%

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr79.6%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-179.6%

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
    11. Simplified74.2%

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

    if 15000 < t < 3.60000000000000024e26

    1. Initial program 63.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-90}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-54}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-27}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 15000:\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.5500000000000001e39 or 1.3e-90 < t < 1.50000000000000005e-54 or 3.4000000000000003e26 < t

    1. Initial program 44.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr77.7%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-177.7%

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

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

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

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

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

    if -1.5500000000000001e39 < t < 1.3e-90 or 1.50000000000000005e-54 < t < 4.60000000000000018e-26

    1. Initial program 90.9%

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

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

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

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

    if 4.60000000000000018e-26 < t < 15500

    1. Initial program 79.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num79.6%

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr79.6%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-179.6%

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

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

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

    if 15500 < t < 3.4000000000000003e26

    1. Initial program 63.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-90}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-54}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-26}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 15500:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 49.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{t - a}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+161}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq -1.55 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;t \leq 3.5 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.9000000000000001e161 or 1.6500000000000001e119 < t

    1. Initial program 34.3%

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

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

    if -1.9000000000000001e161 < t < -1.55e52 or 3.4999999999999999e26 < t < 1.6500000000000001e119

    1. Initial program 57.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a - t}} \]
    7. Step-by-step derivation
      1. mul-1-neg31.8%

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

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

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

    if -1.55e52 < t < -1.5999999999999999e-187

    1. Initial program 83.0%

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

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

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

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

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

    if -1.5999999999999999e-187 < t < -8.0000000000000002e-300

    1. Initial program 91.4%

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

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

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

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

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

    if -8.0000000000000002e-300 < t < 3.4999999999999999e26

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{+161}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \frac{y}{t - a}\\ \mathbf{elif}\;t \leq -1.6 \cdot 10^{-187}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-300}:\\ \;\;\;\;z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+119}:\\ \;\;\;\;t \cdot \frac{y}{t - a}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 65.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;t \leq 3.1 \cdot 10^{-54} \lor \neg \left(t \leq 3.8 \cdot 10^{+26}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.40000000000000001e39 or 2.19999999999999986e-90 < t < 3.10000000000000004e-54 or 3.8000000000000002e26 < t

    1. Initial program 44.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr77.7%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-177.7%

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

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

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

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

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

    if -1.40000000000000001e39 < t < 2.19999999999999986e-90

    1. Initial program 92.1%

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

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

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

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

    if 3.10000000000000004e-54 < t < 3.8000000000000002e26

    1. Initial program 74.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.4 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-90}:\\ \;\;\;\;x + z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-54} \lor \neg \left(t \leq 3.8 \cdot 10^{+26}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{z - t}{t - a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 72.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.7 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.0999999999999996e187 or 4.20000000000000016e79 < z

    1. Initial program 67.0%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-194.3%

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
    11. Simplified83.2%

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

    if -6.0999999999999996e187 < z < -1.69999999999999991e143 or -1.9600000000000001e108 < z < 4.20000000000000016e79

    1. Initial program 64.4%

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

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

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

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

    if -1.69999999999999991e143 < z < -1.9600000000000001e108

    1. Initial program 71.3%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr71.4%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-171.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+187}:\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+143}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;z \leq -1.96 \cdot 10^{+108}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+79}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+189} \lor \neg \left(x \leq 5.5 \cdot 10^{-44}\right) \land \left(x \leq 1.08 \cdot 10^{+14} \lor \neg \left(x \leq 2.05 \cdot 10^{+90}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.49999999999999973e189 or 5.49999999999999993e-44 < x < 1.08e14 or 2.05000000000000021e90 < x

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

    if -4.49999999999999973e189 < x < 5.49999999999999993e-44 or 1.08e14 < x < 2.05000000000000021e90

    1. Initial program 66.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num84.9%

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr84.9%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-184.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+189} \lor \neg \left(x \leq 5.5 \cdot 10^{-44}\right) \land \left(x \leq 1.08 \cdot 10^{+14} \lor \neg \left(x \leq 2.05 \cdot 10^{+90}\right)\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 64.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -7 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 1.4 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.59999999999999969e104 or 1.3999999999999999e95 < a

    1. Initial program 72.8%

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

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

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

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

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

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

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

    if -4.59999999999999969e104 < a < -6.99999999999999941e-278 or 5.69999999999999969e-269 < a < 1.3999999999999999e95

    1. Initial program 61.4%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-179.3%

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

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

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

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

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

    if -6.99999999999999941e-278 < a < 5.69999999999999969e-269

    1. Initial program 74.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr83.7%

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{{\left(\frac{a - t}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-183.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{+104}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;a \leq -7 \cdot 10^{-278}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-269}:\\ \;\;\;\;z \cdot \frac{y - x}{a - t}\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{+95}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 48.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{+51}:\\
\;\;\;\;y\\

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

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

\mathbf{elif}\;t \leq 6.8 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.79999999999999967e51 or 6.8000000000000005e26 < t

    1. Initial program 42.6%

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

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

    if -9.79999999999999967e51 < t < -2e-187

    1. Initial program 83.0%

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

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

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

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

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

    if -2e-187 < t < -2.39999999999999999e-300

    1. Initial program 91.4%

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

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

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

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

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

    if -2.39999999999999999e-300 < t < 6.8000000000000005e26

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.8 \cdot 10^{+51}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-187}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-300}:\\ \;\;\;\;z \cdot \frac{y - x}{a}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 45.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+93}:\\
\;\;\;\;y\\

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

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.5999999999999996e93 or 6.50000000000000022e26 < t

    1. Initial program 39.2%

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

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

    if -7.5999999999999996e93 < t < -1.7500000000000001e-300

    1. Initial program 87.4%

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

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

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

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

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

    if -1.7500000000000001e-300 < t < 6.50000000000000022e26

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

Alternative 15: 75.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{-149} \lor \neg \left(a \leq 5.6 \cdot 10^{+66}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.45e-149 or 5.6000000000000001e66 < a

    1. Initial program 71.1%

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

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

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

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

    if -1.45e-149 < a < 5.6000000000000001e66

    1. Initial program 59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 48.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+83}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq 7 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.00000000000000025e83 or 6.9999999999999998e26 < t

    1. Initial program 39.7%

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

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

    if -8.00000000000000025e83 < t < 6.9999999999999998e26

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

Alternative 17: 38.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+105}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+99}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.7999999999999999e105 or 3.6000000000000002e99 < a

    1. Initial program 72.4%

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

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

    if -6.7999999999999999e105 < a < 3.6000000000000002e99

    1. Initial program 62.3%

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+105}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{+99}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 37.9% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 1.45 \cdot 10^{+100}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.70000000000000001e-93

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot y} \]
    10. Step-by-step derivation
      1. sub-neg40.1%

        \[\leadsto \color{blue}{x + \left(--1 \cdot y\right)} \]
      2. mul-1-neg40.1%

        \[\leadsto x + \left(-\color{blue}{\left(-y\right)}\right) \]
      3. remove-double-neg40.1%

        \[\leadsto x + \color{blue}{y} \]
      4. +-commutative40.1%

        \[\leadsto \color{blue}{y + x} \]
    11. Simplified40.1%

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

    if -1.70000000000000001e-93 < a < 1.45e100

    1. Initial program 62.2%

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

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

    if 1.45e100 < a

    1. Initial program 74.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{-93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+100}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 25.7% accurate, 13.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 65.3%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification21.3%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 86.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024071 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :alt
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))

  (+ x (/ (* (- y x) (- z t)) (- a t))))