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

Percentage Accurate: 67.9% → 91.4%
Time: 29.5s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 67.9% 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: 91.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 + \frac{z - t}{\frac{a - t}{y - x}}\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-301}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;y + \frac{\left(y - x\right) \cdot \left(a - z\right)}{t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a - 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 (/ (- z t) (/ (- a t) (- y x))))
     (if (<= t_1 -2e-301)
       t_1
       (if (<= t_1 0.0)
         (+ y (/ (* (- y x) (- a z)) t))
         (if (<= t_1 2e+296) t_1 (+ x (* (- z t) (/ (- y x) (- 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 <= -((double) INFINITY)) {
		tmp = x + ((z - t) / ((a - t) / (y - x)));
	} else if (t_1 <= -2e-301) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((y - x) * (a - z)) / t);
	} else if (t_1 <= 2e+296) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) / (a - 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 + ((z - t) / ((a - t) / (y - x)));
	} else if (t_1 <= -2e-301) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = y + (((y - x) * (a - z)) / t);
	} else if (t_1 <= 2e+296) {
		tmp = t_1;
	} else {
		tmp = x + ((z - t) * ((y - x) / (a - 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 + ((z - t) / ((a - t) / (y - x)))
	elif t_1 <= -2e-301:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = y + (((y - x) * (a - z)) / t)
	elif t_1 <= 2e+296:
		tmp = t_1
	else:
		tmp = x + ((z - t) * ((y - x) / (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 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / Float64(y - x))));
	elseif (t_1 <= -2e-301)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(y + Float64(Float64(Float64(y - x) * Float64(a - z)) / t));
	elseif (t_1 <= 2e+296)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(Float64(z - t) * Float64(Float64(y - x) / Float64(a - 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 + ((z - t) / ((a - t) / (y - x)));
	elseif (t_1 <= -2e-301)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = y + (((y - x) * (a - z)) / t);
	elseif (t_1 <= 2e+296)
		tmp = t_1;
	else
		tmp = x + ((z - t) * ((y - x) / (a - 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[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-301], t$95$1, If[LessEqual[t$95$1, 0.0], N[(y + N[(N[(N[(y - x), $MachinePrecision] * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+296], t$95$1, N[(x + N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $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 + \frac{z - t}{\frac{a - t}{y - x}}\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-301}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+296}:\\
\;\;\;\;t\_1\\

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


\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

    1. Initial program 40.3%

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -2.00000000000000013e-301 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.99999999999999996e296

    1. Initial program 96.2%

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

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

    1. Initial program 4.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv4.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \frac{\color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)} - -1 \cdot \left(a \cdot \left(y - x\right)\right)}{t} \]
      11. 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} \]
      12. associate-*r/99.9%

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

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

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

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

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

    1. Initial program 50.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;x + \frac{z - t}{\frac{a - t}{y - x}}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -2 \cdot 10^{-301}:\\ \;\;\;\;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(a - z\right)}{t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 2 \cdot 10^{+296}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a - t}\\ \end{array} \]
  5. Add Preprocessing

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

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

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


\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))) < -2.00000000000000013e-301

    1. Initial program 80.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv93.9%

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

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

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

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

    1. Initial program 4.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv4.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \frac{\color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)} - -1 \cdot \left(a \cdot \left(y - x\right)\right)}{t} \]
      11. 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} \]
      12. associate-*r/99.9%

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

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

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

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

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

    1. Initial program 82.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y - x}}} + x \]
      4. associate-/r/94.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -2 \cdot 10^{-301}:\\ \;\;\;\;x + \left(x - y\right) \cdot \frac{t - z}{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{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 91.4% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(z - t\right) \cdot \frac{y - x}{a - 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 -2 \cdot 10^{-301}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+296}:\\
\;\;\;\;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 1.99999999999999996e296 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 45.0%

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -2.00000000000000013e-301 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.99999999999999996e296

    1. Initial program 96.2%

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

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

    1. Initial program 4.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv4.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \frac{\color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)} - -1 \cdot \left(a \cdot \left(y - x\right)\right)}{t} \]
      11. 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} \]
      12. associate-*r/99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a - t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq -2 \cdot 10^{-301}:\\ \;\;\;\;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(a - z\right)}{t}\\ \mathbf{elif}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \leq 2 \cdot 10^{+296}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y - x}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.0% accurate, 0.3× 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 -2 \cdot 10^{-301} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;x + \left(x - y\right) \cdot \frac{t - z}{a - t}\\ \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 -2e-301) (not (<= t_1 0.0)))
     (+ x (* (- x y) (/ (- t z) (- a t))))
     (- 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 <= -2e-301) || !(t_1 <= 0.0)) {
		tmp = x + ((x - y) * ((t - z) / (a - t)));
	} else {
		tmp = y - (((y - x) * (z - 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) :: t_1
    real(8) :: tmp
    t_1 = x + (((y - x) * (z - t)) / (a - t))
    if ((t_1 <= (-2d-301)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = x + ((x - y) * ((t - z) / (a - t)))
    else
        tmp = y - (((y - x) * (z - a)) / t)
    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) * (z - t)) / (a - t));
	double tmp;
	if ((t_1 <= -2e-301) || !(t_1 <= 0.0)) {
		tmp = x + ((x - y) * ((t - z) / (a - t)));
	} else {
		tmp = y - (((y - x) * (z - a)) / t);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (((y - x) * (z - t)) / (a - t))
	tmp = 0
	if (t_1 <= -2e-301) or not (t_1 <= 0.0):
		tmp = x + ((x - y) * ((t - z) / (a - t)))
	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 <= -2e-301) || !(t_1 <= 0.0))
		tmp = Float64(x + Float64(Float64(x - y) * Float64(Float64(t - z) / Float64(a - t))));
	else
		tmp = Float64(y - Float64(Float64(Float64(y - x) * Float64(z - a)) / 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 <= -2e-301) || ~((t_1 <= 0.0)))
		tmp = x + ((x - y) * ((t - z) / (a - t)));
	else
		tmp = y - (((y - x) * (z - a)) / 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[Or[LessEqual[t$95$1, -2e-301], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(N[(x - y), $MachinePrecision] * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -2 \cdot 10^{-301} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;x + \left(x - y\right) \cdot \frac{t - z}{a - t}\\

\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))) < -2.00000000000000013e-301 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t)))

    1. Initial program 81.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv94.0%

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

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

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

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

    1. Initial program 4.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv4.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \frac{\color{blue}{-1 \cdot \left(z \cdot \left(y - x\right)\right)} - -1 \cdot \left(a \cdot \left(y - x\right)\right)}{t} \]
      11. 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} \]
      12. associate-*r/99.9%

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

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

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

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

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

Alternative 5: 73.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -4.9 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.5999999999999999e24

    1. Initial program 81.9%

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

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

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

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

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

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

    if -1.5999999999999999e24 < a < -4.90000000000000019e-111 or 9.2000000000000003e-200 < a < 1.5000000000000001e-119

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u40.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef19.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*24.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr24.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def46.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p78.3%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/61.9%

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

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

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

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

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

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

    if -4.90000000000000019e-111 < a < 9.2000000000000003e-200

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5000000000000001e-119 < a

    1. Initial program 76.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{+24}:\\ \;\;\;\;x - \frac{x - y}{\frac{a}{z - t}}\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{-111}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-200}:\\ \;\;\;\;y - \frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-119}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z - t\right) \cdot \frac{y}{a - t}\\ t_2 := y + \frac{x - y}{\frac{t}{z - a}}\\ \mathbf{if}\;t \leq -3.7 \cdot 10^{+47}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-68}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a - t}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+137}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- z t) (/ y (- a t)))))
        (t_2 (+ y (/ (- x y) (/ t (- z a))))))
   (if (<= t -3.7e+47)
     t_2
     (if (<= t -3.8e-159)
       t_1
       (if (<= t 6e-68)
         (- x (/ (* z (- x y)) (- a t)))
         (if (<= t 3.4e+137) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((z - t) * (y / (a - t)));
	double t_2 = y + ((x - y) / (t / (z - a)));
	double tmp;
	if (t <= -3.7e+47) {
		tmp = t_2;
	} else if (t <= -3.8e-159) {
		tmp = t_1;
	} else if (t <= 6e-68) {
		tmp = x - ((z * (x - y)) / (a - t));
	} else if (t <= 3.4e+137) {
		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 + ((z - t) * (y / (a - t)))
    t_2 = y + ((x - y) / (t / (z - a)))
    if (t <= (-3.7d+47)) then
        tmp = t_2
    else if (t <= (-3.8d-159)) then
        tmp = t_1
    else if (t <= 6d-68) then
        tmp = x - ((z * (x - y)) / (a - t))
    else if (t <= 3.4d+137) 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 + ((z - t) * (y / (a - t)));
	double t_2 = y + ((x - y) / (t / (z - a)));
	double tmp;
	if (t <= -3.7e+47) {
		tmp = t_2;
	} else if (t <= -3.8e-159) {
		tmp = t_1;
	} else if (t <= 6e-68) {
		tmp = x - ((z * (x - y)) / (a - t));
	} else if (t <= 3.4e+137) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((z - t) * (y / (a - t)))
	t_2 = y + ((x - y) / (t / (z - a)))
	tmp = 0
	if t <= -3.7e+47:
		tmp = t_2
	elif t <= -3.8e-159:
		tmp = t_1
	elif t <= 6e-68:
		tmp = x - ((z * (x - y)) / (a - t))
	elif t <= 3.4e+137:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t))))
	t_2 = Float64(y + Float64(Float64(x - y) / Float64(t / Float64(z - a))))
	tmp = 0.0
	if (t <= -3.7e+47)
		tmp = t_2;
	elseif (t <= -3.8e-159)
		tmp = t_1;
	elseif (t <= 6e-68)
		tmp = Float64(x - Float64(Float64(z * Float64(x - y)) / Float64(a - t)));
	elseif (t <= 3.4e+137)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((z - t) * (y / (a - t)));
	t_2 = y + ((x - y) / (t / (z - a)));
	tmp = 0.0;
	if (t <= -3.7e+47)
		tmp = t_2;
	elseif (t <= -3.8e-159)
		tmp = t_1;
	elseif (t <= 6e-68)
		tmp = x - ((z * (x - y)) / (a - t));
	elseif (t <= 3.4e+137)
		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[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(N[(x - y), $MachinePrecision] / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.7e+47], t$95$2, If[LessEqual[t, -3.8e-159], t$95$1, If[LessEqual[t, 6e-68], N[(x - N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+137], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -3.8 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 3.4 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.70000000000000041e47 or 3.39999999999999986e137 < t

    1. Initial program 44.9%

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

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

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

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

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

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

        \[\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. div-sub72.2%

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

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

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

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

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

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

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

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

    if -3.70000000000000041e47 < t < -3.8000000000000001e-159 or 6e-68 < t < 3.39999999999999986e137

    1. Initial program 83.9%

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

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

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

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

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

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

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

    if -3.8000000000000001e-159 < t < 6e-68

    1. Initial program 94.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{+47}:\\ \;\;\;\;y + \frac{x - y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-159}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-68}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a - t}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{+137}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;y + \frac{x - y}{\frac{t}{z - a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -3.9 \cdot 10^{+115}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{+64}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-123} \lor \neg \left(t \leq 2.9 \cdot 10^{-60}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y - x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- a t)))))
   (if (<= t -3.9e+115)
     t_1
     (if (<= t -4.2e+64)
       (* (- y x) (/ z (- a t)))
       (if (or (<= t -4.8e-123) (not (<= t 2.9e-60)))
         t_1
         (+ x (/ z (/ a (- y x)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (a - t));
	double tmp;
	if (t <= -3.9e+115) {
		tmp = t_1;
	} else if (t <= -4.2e+64) {
		tmp = (y - x) * (z / (a - t));
	} else if ((t <= -4.8e-123) || !(t <= 2.9e-60)) {
		tmp = t_1;
	} else {
		tmp = x + (z / (a / (y - x)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((z - t) / (a - t))
    if (t <= (-3.9d+115)) then
        tmp = t_1
    else if (t <= (-4.2d+64)) then
        tmp = (y - x) * (z / (a - t))
    else if ((t <= (-4.8d-123)) .or. (.not. (t <= 2.9d-60))) then
        tmp = t_1
    else
        tmp = x + (z / (a / (y - x)))
    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 <= -3.9e+115) {
		tmp = t_1;
	} else if (t <= -4.2e+64) {
		tmp = (y - x) * (z / (a - t));
	} else if ((t <= -4.8e-123) || !(t <= 2.9e-60)) {
		tmp = t_1;
	} else {
		tmp = x + (z / (a / (y - x)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((z - t) / (a - t))
	tmp = 0
	if t <= -3.9e+115:
		tmp = t_1
	elif t <= -4.2e+64:
		tmp = (y - x) * (z / (a - t))
	elif (t <= -4.8e-123) or not (t <= 2.9e-60):
		tmp = t_1
	else:
		tmp = x + (z / (a / (y - x)))
	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 <= -3.9e+115)
		tmp = t_1;
	elseif (t <= -4.2e+64)
		tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t)));
	elseif ((t <= -4.8e-123) || !(t <= 2.9e-60))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(z / Float64(a / Float64(y - x))));
	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 <= -3.9e+115)
		tmp = t_1;
	elseif (t <= -4.2e+64)
		tmp = (y - x) * (z / (a - t));
	elseif ((t <= -4.8e-123) || ~((t <= 2.9e-60)))
		tmp = t_1;
	else
		tmp = x + (z / (a / (y - x)));
	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, -3.9e+115], t$95$1, If[LessEqual[t, -4.2e+64], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.8e-123], N[Not[LessEqual[t, 2.9e-60]], $MachinePrecision]], t$95$1, N[(x + N[(z / N[(a / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -4.8 \cdot 10^{-123} \lor \neg \left(t \leq 2.9 \cdot 10^{-60}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.90000000000000006e115 or -4.2000000000000001e64 < t < -4.8e-123 or 2.8999999999999999e-60 < t

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv81.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u39.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef15.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*20.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr20.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def44.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p67.9%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/54.5%

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

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

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

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

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

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

    if -3.90000000000000006e115 < t < -4.2000000000000001e64

    1. Initial program 83.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv90.9%

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. associate-*r/56.9%

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

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

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

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

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

    if -4.8e-123 < t < 2.8999999999999999e-60

    1. Initial program 93.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{+115}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{+64}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-123} \lor \neg \left(t \leq 2.9 \cdot 10^{-60}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 64.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -1.36 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{+64}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-125} \lor \neg \left(t \leq 1.75 \cdot 10^{-60}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- a t)))))
   (if (<= t -1.36e+116)
     t_1
     (if (<= t -2.1e+64)
       (* (- y x) (/ z (- a t)))
       (if (or (<= t -2.3e-125) (not (<= t 1.75e-60)))
         t_1
         (- x (/ (* z (- x y)) a)))))))
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.36e+116) {
		tmp = t_1;
	} else if (t <= -2.1e+64) {
		tmp = (y - x) * (z / (a - t));
	} else if ((t <= -2.3e-125) || !(t <= 1.75e-60)) {
		tmp = t_1;
	} else {
		tmp = x - ((z * (x - y)) / a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((z - t) / (a - t))
    if (t <= (-1.36d+116)) then
        tmp = t_1
    else if (t <= (-2.1d+64)) then
        tmp = (y - x) * (z / (a - t))
    else if ((t <= (-2.3d-125)) .or. (.not. (t <= 1.75d-60))) then
        tmp = t_1
    else
        tmp = x - ((z * (x - y)) / a)
    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.36e+116) {
		tmp = t_1;
	} else if (t <= -2.1e+64) {
		tmp = (y - x) * (z / (a - t));
	} else if ((t <= -2.3e-125) || !(t <= 1.75e-60)) {
		tmp = t_1;
	} else {
		tmp = x - ((z * (x - y)) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((z - t) / (a - t))
	tmp = 0
	if t <= -1.36e+116:
		tmp = t_1
	elif t <= -2.1e+64:
		tmp = (y - x) * (z / (a - t))
	elif (t <= -2.3e-125) or not (t <= 1.75e-60):
		tmp = t_1
	else:
		tmp = x - ((z * (x - y)) / a)
	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.36e+116)
		tmp = t_1;
	elseif (t <= -2.1e+64)
		tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t)));
	elseif ((t <= -2.3e-125) || !(t <= 1.75e-60))
		tmp = t_1;
	else
		tmp = Float64(x - Float64(Float64(z * Float64(x - y)) / a));
	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.36e+116)
		tmp = t_1;
	elseif (t <= -2.1e+64)
		tmp = (y - x) * (z / (a - t));
	elseif ((t <= -2.3e-125) || ~((t <= 1.75e-60)))
		tmp = t_1;
	else
		tmp = x - ((z * (x - y)) / a);
	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.36e+116], t$95$1, If[LessEqual[t, -2.1e+64], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.3e-125], N[Not[LessEqual[t, 1.75e-60]], $MachinePrecision]], t$95$1, N[(x - N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-125} \lor \neg \left(t \leq 1.75 \cdot 10^{-60}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.36e116 or -2.1e64 < t < -2.2999999999999999e-125 or 1.74999999999999988e-60 < t

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv81.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u39.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef15.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*20.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr20.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def44.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p67.9%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/54.5%

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

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

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

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

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

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

    if -1.36e116 < t < -2.1e64

    1. Initial program 83.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv90.9%

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{a - t}} \]
      2. associate-*r/56.9%

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

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

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

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

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

    if -2.2999999999999999e-125 < t < 1.74999999999999988e-60

    1. Initial program 93.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.36 \cdot 10^{+116}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{+64}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-125} \lor \neg \left(t \leq 1.75 \cdot 10^{-60}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 64.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -2.4 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{+64}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y - x}}\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-123} \lor \neg \left(t \leq 5.1 \cdot 10^{-61}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- a t)))))
   (if (<= t -2.4e+116)
     t_1
     (if (<= t -2.1e+64)
       (- x (/ z (/ t (- y x))))
       (if (or (<= t -1.3e-123) (not (<= t 5.1e-61)))
         t_1
         (- x (/ (* z (- x y)) a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (a - t));
	double tmp;
	if (t <= -2.4e+116) {
		tmp = t_1;
	} else if (t <= -2.1e+64) {
		tmp = x - (z / (t / (y - x)));
	} else if ((t <= -1.3e-123) || !(t <= 5.1e-61)) {
		tmp = t_1;
	} else {
		tmp = x - ((z * (x - y)) / a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((z - t) / (a - t))
    if (t <= (-2.4d+116)) then
        tmp = t_1
    else if (t <= (-2.1d+64)) then
        tmp = x - (z / (t / (y - x)))
    else if ((t <= (-1.3d-123)) .or. (.not. (t <= 5.1d-61))) then
        tmp = t_1
    else
        tmp = x - ((z * (x - y)) / a)
    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 <= -2.4e+116) {
		tmp = t_1;
	} else if (t <= -2.1e+64) {
		tmp = x - (z / (t / (y - x)));
	} else if ((t <= -1.3e-123) || !(t <= 5.1e-61)) {
		tmp = t_1;
	} else {
		tmp = x - ((z * (x - y)) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((z - t) / (a - t))
	tmp = 0
	if t <= -2.4e+116:
		tmp = t_1
	elif t <= -2.1e+64:
		tmp = x - (z / (t / (y - x)))
	elif (t <= -1.3e-123) or not (t <= 5.1e-61):
		tmp = t_1
	else:
		tmp = x - ((z * (x - y)) / a)
	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 <= -2.4e+116)
		tmp = t_1;
	elseif (t <= -2.1e+64)
		tmp = Float64(x - Float64(z / Float64(t / Float64(y - x))));
	elseif ((t <= -1.3e-123) || !(t <= 5.1e-61))
		tmp = t_1;
	else
		tmp = Float64(x - Float64(Float64(z * Float64(x - y)) / a));
	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 <= -2.4e+116)
		tmp = t_1;
	elseif (t <= -2.1e+64)
		tmp = x - (z / (t / (y - x)));
	elseif ((t <= -1.3e-123) || ~((t <= 5.1e-61)))
		tmp = t_1;
	else
		tmp = x - ((z * (x - y)) / a);
	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, -2.4e+116], t$95$1, If[LessEqual[t, -2.1e+64], N[(x - N[(z / N[(t / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.3e-123], N[Not[LessEqual[t, 5.1e-61]], $MachinePrecision]], t$95$1, N[(x - N[(N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -1.3 \cdot 10^{-123} \lor \neg \left(t \leq 5.1 \cdot 10^{-61}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.4e116 or -2.1e64 < t < -1.29999999999999998e-123 or 5.09999999999999968e-61 < t

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv81.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u39.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef15.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*20.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr20.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def44.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p67.9%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/54.5%

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

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

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

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

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

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

    if -2.4e116 < t < -2.1e64

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

    if -1.29999999999999998e-123 < t < 5.09999999999999968e-61

    1. Initial program 93.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+116}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{+64}:\\ \;\;\;\;x - \frac{z}{\frac{t}{y - x}}\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-123} \lor \neg \left(t \leq 5.1 \cdot 10^{-61}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 57.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ t_2 := x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{if}\;a \leq -1.9 \cdot 10^{+25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 7 \cdot 10^{-72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 320000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+161}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- z t) (- a t)))) (t_2 (* x (- 1.0 (/ z a)))))
   (if (<= a -1.9e+25)
     t_2
     (if (<= a 7e-72)
       t_1
       (if (<= a 320000.0)
         t_2
         (if (<= a 9.5e+161) t_1 (+ x (/ y (/ a z)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (a - t));
	double t_2 = x * (1.0 - (z / a));
	double tmp;
	if (a <= -1.9e+25) {
		tmp = t_2;
	} else if (a <= 7e-72) {
		tmp = t_1;
	} else if (a <= 320000.0) {
		tmp = t_2;
	} else if (a <= 9.5e+161) {
		tmp = t_1;
	} else {
		tmp = x + (y / (a / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * ((z - t) / (a - t))
    t_2 = x * (1.0d0 - (z / a))
    if (a <= (-1.9d+25)) then
        tmp = t_2
    else if (a <= 7d-72) then
        tmp = t_1
    else if (a <= 320000.0d0) then
        tmp = t_2
    else if (a <= 9.5d+161) then
        tmp = t_1
    else
        tmp = x + (y / (a / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((z - t) / (a - t));
	double t_2 = x * (1.0 - (z / a));
	double tmp;
	if (a <= -1.9e+25) {
		tmp = t_2;
	} else if (a <= 7e-72) {
		tmp = t_1;
	} else if (a <= 320000.0) {
		tmp = t_2;
	} else if (a <= 9.5e+161) {
		tmp = t_1;
	} else {
		tmp = x + (y / (a / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((z - t) / (a - t))
	t_2 = x * (1.0 - (z / a))
	tmp = 0
	if a <= -1.9e+25:
		tmp = t_2
	elif a <= 7e-72:
		tmp = t_1
	elif a <= 320000.0:
		tmp = t_2
	elif a <= 9.5e+161:
		tmp = t_1
	else:
		tmp = x + (y / (a / z))
	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(1.0 - Float64(z / a)))
	tmp = 0.0
	if (a <= -1.9e+25)
		tmp = t_2;
	elseif (a <= 7e-72)
		tmp = t_1;
	elseif (a <= 320000.0)
		tmp = t_2;
	elseif (a <= 9.5e+161)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y / Float64(a / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((z - t) / (a - t));
	t_2 = x * (1.0 - (z / a));
	tmp = 0.0;
	if (a <= -1.9e+25)
		tmp = t_2;
	elseif (a <= 7e-72)
		tmp = t_1;
	elseif (a <= 320000.0)
		tmp = t_2;
	elseif (a <= 9.5e+161)
		tmp = t_1;
	else
		tmp = x + (y / (a / z));
	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[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e+25], t$95$2, If[LessEqual[a, 7e-72], t$95$1, If[LessEqual[a, 320000.0], t$95$2, If[LessEqual[a, 9.5e+161], t$95$1, N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq 320000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.9e25 or 7.00000000000000001e-72 < a < 3.2e5

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

    if -1.9e25 < a < 7.00000000000000001e-72 or 3.2e5 < a < 9.50000000000000061e161

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u40.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef20.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*23.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr23.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def43.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p67.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/52.1%

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

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

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

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

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

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

    if 9.50000000000000061e161 < a

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

Alternative 11: 66.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -48:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.55 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.90000000000000007e119 or -48 < t < -1.5499999999999999e-124

    1. Initial program 63.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv87.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u39.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef14.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*21.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr21.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def46.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p77.7%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/63.7%

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

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

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

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

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

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

    if -2.90000000000000007e119 < t < -48 or 9.99999999999999946e33 < t

    1. Initial program 54.3%

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

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

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

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

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

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

        \[\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. div-sub61.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto y - \color{blue}{\frac{z}{\frac{t}{y - x}}} \]
    10. Simplified68.5%

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

    if -1.5499999999999999e-124 < t < 9.99999999999999946e33

    1. Initial program 93.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+119}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq -48:\\ \;\;\;\;y - \frac{z}{\frac{t}{y - x}}\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{-124}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;t \leq 10^{+34}:\\ \;\;\;\;x - \frac{z \cdot \left(x - y\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;y - \frac{z}{\frac{t}{y - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 53.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq -2.7 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.08 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.50000000000000042e49 or 1.07999999999999994e136 < t

    1. Initial program 45.4%

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

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

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

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

    if -5.50000000000000042e49 < t < -2.70000000000000008e-247 or 1.25000000000000009e-230 < t < 1.07999999999999994e136

    1. Initial program 87.0%

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

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

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

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

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

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

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

    if -2.70000000000000008e-247 < t < 1.25000000000000009e-230

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{+49}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-247}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-230}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{+136}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 68.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := y + \frac{x - y}{\frac{t}{z}}\\
\mathbf{if}\;t \leq -43:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -43 or 3.19999999999999985e38 < t

    1. Initial program 52.3%

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

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

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

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

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

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

        \[\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. div-sub64.6%

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

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

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

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

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

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

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

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

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

    if -43 < t < -2.5000000000000001e-124

    1. Initial program 84.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv96.0%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u31.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)\right)} \]
      2. expm1-udef23.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(z - t\right)}{a - t}\right)} - 1} \]
      3. associate-/l*23.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{a - t}{z - t}}}\right)} - 1 \]
    9. Applied egg-rr23.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def31.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\frac{a - t}{z - t}}\right)\right)} \]
      2. expm1-log1p68.9%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      3. associate-/r/65.0%

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

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

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

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

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

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

    if -2.5000000000000001e-124 < t < 3.19999999999999985e38

    1. Initial program 93.8%

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

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

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

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

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

Alternative 14: 68.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := y + \frac{x - y}{\frac{t}{z}}\\
\mathbf{if}\;t \leq -102:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -102 or 2.7000000000000002e28 < t

    1. Initial program 52.3%

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

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

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

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

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

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

        \[\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. div-sub64.6%

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

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

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

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

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

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

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

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

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

    if -102 < t < -4.8e-123

    1. Initial program 84.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{a - t}{z - t}}} + x \]
      3. div-inv96.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
    9. Simplified68.9%

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

    if -4.8e-123 < t < 2.7000000000000002e28

    1. Initial program 93.8%

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

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

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

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

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

Alternative 15: 87.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+197} \lor \neg \left(t \leq 2.4 \cdot 10^{+146}\right):\\
\;\;\;\;y + \frac{x - y}{\frac{t}{z - a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.8000000000000001e197 or 2.4000000000000002e146 < t

    1. Initial program 36.8%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{a - t} \cdot \left(z - t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 79.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}} \]
    6. Step-by-step derivation
      1. associate--l+79.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. associate-*r/79.1%

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

        \[\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. div-sub79.1%

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

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

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

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

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

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

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

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

    if -3.8000000000000001e197 < t < 2.4000000000000002e146

    1. Initial program 84.6%

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

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

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

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

Alternative 16: 76.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.10000000000000011e49 or 8.00000000000000047e136 < t

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000011e49 < t < 8.00000000000000047e136

    1. Initial program 88.3%

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

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

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

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

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

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

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

Alternative 17: 76.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-17} \lor \neg \left(a \leq 1.95 \cdot 10^{-84}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.2000000000000002e-17 or 1.95000000000000011e-84 < a

    1. Initial program 77.9%

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

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

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

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

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

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

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

    if -3.2000000000000002e-17 < a < 1.95000000000000011e-84

    1. Initial program 71.4%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{a - t} \cdot \left(z - t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 71.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}} \]
    6. Step-by-step derivation
      1. associate--l+71.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/71.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/71.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. div-sub72.8%

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

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

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

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

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

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

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

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

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

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

Alternative 18: 75.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

    if -2.05e21 < a < 2.90000000000000019e-84

    1. Initial program 69.9%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{a - t} \cdot \left(z - t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 71.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}} \]
    6. Step-by-step derivation
      1. associate--l+71.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. associate-*r/71.0%

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

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

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

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

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

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

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

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

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

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

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

    if 2.90000000000000019e-84 < a

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

Alternative 19: 53.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

    if -2.05e21 < a < 1.25e-73

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{t}{z - t}}} \]
      3. distribute-neg-frac58.0%

        \[\leadsto \color{blue}{\frac{-y}{\frac{t}{z - t}}} \]
    10. Simplified58.0%

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

    if 1.25e-73 < a

    1. Initial program 76.6%

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

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

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

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

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

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

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

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

Alternative 20: 49.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 7 \cdot 10^{+135}:\\
\;\;\;\;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 < -5.5999999999999996e49 or 7.0000000000000005e135 < t

    1. Initial program 45.4%

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

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

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

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

    if -5.5999999999999996e49 < t < 7.0000000000000005e135

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

Alternative 21: 52.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

    if -2e21 < a < 1.20000000000000003e-73

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y \cdot \left(z - t\right)\right)}{t}} \]
      2. neg-mul-147.2%

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

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

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

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

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

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

        \[\leadsto y - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      4. associate-/r/54.1%

        \[\leadsto y - \color{blue}{\frac{y}{t} \cdot z} \]
    13. Simplified54.1%

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

    if 1.20000000000000003e-73 < a

    1. Initial program 76.6%

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

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

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

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

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

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

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

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

Alternative 22: 37.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-96}:\\
\;\;\;\;y\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+138}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9999999999999996e-96 or 1.3e138 < t

    1. Initial program 53.9%

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

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

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

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

    if -3.9999999999999996e-96 < t < 1.3e138

    1. Initial program 89.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-96}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+138}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 24.2% 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 75.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification26.8%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 86.9% 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 2024031 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (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))))