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

Percentage Accurate: 67.6% → 90.7%
Time: 14.2s
Alternatives: 14
Speedup: 0.5×

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 14 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 90.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(z - t\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{a - t}\right)\\ t_2 := x - \frac{\left(z - t\right) \cdot \left(x - y\right)}{a - t}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-248}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;y + \frac{z - a}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+226}:\\ \;\;\;\;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) (/ 1.0 (- a t))))))
        (t_2 (- x (/ (* (- z t) (- x y)) (- a t)))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -5e-248)
       t_2
       (if (<= t_2 0.0)
         (+ y (* (/ (- z a) t) (- x y)))
         (if (<= t_2 2e+226) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t))));
	double t_2 = x - (((z - t) * (x - y)) / (a - t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -5e-248) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y + (((z - a) / t) * (x - y));
	} else if (t_2 <= 2e+226) {
		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) * (1.0 / (a - t))));
	double t_2 = x - (((z - t) * (x - y)) / (a - t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -5e-248) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y + (((z - a) / t) * (x - y));
	} else if (t_2 <= 2e+226) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((z - t) * ((y - x) * (1.0 / (a - t))))
	t_2 = x - (((z - t) * (x - y)) / (a - t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -5e-248:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = y + (((z - a) / t) * (x - y))
	elif t_2 <= 2e+226:
		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(1.0 / Float64(a - t)))))
	t_2 = Float64(x - Float64(Float64(Float64(z - t) * Float64(x - y)) / Float64(a - t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -5e-248)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(y + Float64(Float64(Float64(z - a) / t) * Float64(x - y)));
	elseif (t_2 <= 2e+226)
		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) * (1.0 / (a - t))));
	t_2 = x - (((z - t) * (x - y)) / (a - t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -5e-248)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = y + (((z - a) / t) * (x - y));
	elseif (t_2 <= 2e+226)
		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[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(N[(z - t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-248], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y + N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+226], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

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

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

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

    1. Initial program 36.8%

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000001e-248 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 1.99999999999999992e226

    1. Initial program 97.3%

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

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

    1. Initial program 9.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y - x}{a - t}, x\right)} \]
    8. Taylor expanded in t around inf 94.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}} \]
    9. Step-by-step derivation
      1. associate--l+94.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/94.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/94.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. mul-1-neg94.9%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.4% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

    1. Initial program 9.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y - x}{a - t}, x\right)} \]
    8. Taylor expanded in t around inf 94.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}} \]
    9. Step-by-step derivation
      1. associate--l+94.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/94.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/94.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. mul-1-neg94.9%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.2% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 65.3%

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

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

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

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

    if -1.45000000000000005e123 < a < -1.39999999999999998e-34 or 4.5999999999999998e-49 < a

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \frac{z - t}{1}} \]
      3. /-rgt-identity82.7%

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

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

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

    if -1.39999999999999998e-34 < a < 4.5999999999999998e-49

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - t, \frac{y - x}{a - t}, x\right)} \]
    8. Taylor expanded in t around inf 69.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}} \]
    9. Step-by-step derivation
      1. associate--l+69.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/69.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/69.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. mul-1-neg69.9%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.4% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 65.3%

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

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

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

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

    if -3.0500000000000001e123 < a < -4.5000000000000004e-37 or 4.1999999999999999e-165 < a

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \frac{z - t}{1}} \]
      3. /-rgt-identity77.7%

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

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

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

    if -4.5000000000000004e-37 < a < 4.1999999999999999e-165

    1. Initial program 62.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 73.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+73.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/73.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/73.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. mul-1-neg73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 72.2% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.19999999999999995e-44 or 1.22e37 < a

    1. Initial program 69.7%

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

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

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

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

    if -3.19999999999999995e-44 < a < 8.2e-172

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2e-172 < a < 1.22e37

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 68.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-42}:\\
\;\;\;\;x - z \cdot \frac{x - y}{a}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.5e-42

    1. Initial program 67.9%

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

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

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

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

    if -5.5e-42 < a < 6.50000000000000012e-172

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.50000000000000012e-172 < a < 1.65e38

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65e38 < a

    1. Initial program 72.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{-42}:\\ \;\;\;\;x - z \cdot \frac{x - y}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-172}:\\ \;\;\;\;y + z \cdot \frac{x - y}{t}\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+38}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 37.5% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+122}:\\
\;\;\;\;y \cdot \frac{t}{t - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.99999999999999983e29 or 4.49999999999999997e122 < a

    1. Initial program 69.0%

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

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

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

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

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

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

    if -1.99999999999999983e29 < a < -1.74999999999999989e-255

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.74999999999999989e-255 < a < 4.49999999999999997e122

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{-t}{a - t}} \]
    14. Step-by-step derivation
      1. frac-2neg45.7%

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

        \[\leadsto y \cdot \color{blue}{\left(\left(-\left(-t\right)\right) \cdot \frac{1}{-\left(a - t\right)}\right)} \]
      3. remove-double-neg45.6%

        \[\leadsto y \cdot \left(\color{blue}{t} \cdot \frac{1}{-\left(a - t\right)}\right) \]
      4. sub-neg45.6%

        \[\leadsto y \cdot \left(t \cdot \frac{1}{-\color{blue}{\left(a + \left(-t\right)\right)}}\right) \]
      5. distribute-neg-in45.6%

        \[\leadsto y \cdot \left(t \cdot \frac{1}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}\right) \]
      6. remove-double-neg45.6%

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

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

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

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{t + \left(-a\right)}} \]
      4. unsub-neg45.7%

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

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

Alternative 8: 64.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+89} \lor \neg \left(a \leq 1.22 \cdot 10^{+38}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.5000000000000003e89 or 1.22e38 < a

    1. Initial program 69.3%

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

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

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

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

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

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

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

    if -9.5000000000000003e89 < a < 1.22e38

    1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+130} \lor \neg \left(a \leq 2.35 \cdot 10^{+123}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3999999999999999e130 or 2.3499999999999999e123 < a

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \frac{z - t}{1}} \]
      3. /-rgt-identity87.0%

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

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
    10. Taylor expanded in t around 0 77.5%

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

    if -1.3999999999999999e130 < a < 2.3499999999999999e123

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 64.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 66.4%

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

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

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

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

    if -5.49999999999999976e89 < a < 1.2e37

    1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e37 < a

    1. Initial program 72.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+89}:\\ \;\;\;\;x - z \cdot \frac{x - y}{a}\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+37}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 54.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -225000 \lor \neg \left(t \leq 4.2 \cdot 10^{+19}\right):\\
\;\;\;\;y \cdot \frac{t}{t - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -225000 or 4.2e19 < t

    1. Initial program 46.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{a - t}\right)} \]
      2. distribute-neg-frac51.6%

        \[\leadsto y \cdot \color{blue}{\frac{-t}{a - t}} \]
    13. Simplified51.6%

      \[\leadsto y \cdot \color{blue}{\frac{-t}{a - t}} \]
    14. Step-by-step derivation
      1. frac-2neg51.6%

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

        \[\leadsto y \cdot \color{blue}{\left(\left(-\left(-t\right)\right) \cdot \frac{1}{-\left(a - t\right)}\right)} \]
      3. remove-double-neg51.5%

        \[\leadsto y \cdot \left(\color{blue}{t} \cdot \frac{1}{-\left(a - t\right)}\right) \]
      4. sub-neg51.5%

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

        \[\leadsto y \cdot \left(t \cdot \frac{1}{\color{blue}{\left(-a\right) + \left(-\left(-t\right)\right)}}\right) \]
      6. remove-double-neg51.5%

        \[\leadsto y \cdot \left(t \cdot \frac{1}{\left(-a\right) + \color{blue}{t}}\right) \]
    15. Applied egg-rr51.5%

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

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

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

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{t - a}} \]
    17. Simplified51.6%

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

    if -225000 < t < 4.2e19

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \frac{z - t}{1}} \]
      3. /-rgt-identity72.1%

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

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
    10. Taylor expanded in t around 0 61.7%

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

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

Alternative 12: 37.2% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.95 \cdot 10^{+38}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.7999999999999999e34 or 1.95000000000000012e38 < a

    1. Initial program 68.5%

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

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

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

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

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

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

    if -6.7999999999999999e34 < a < -2.6000000000000001e-256

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000001e-256 < a < 1.95000000000000012e38

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 1.75 \cdot 10^{+38}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.65e86 or 1.75000000000000001e38 < a

    1. Initial program 68.7%

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

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

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

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

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

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

    if -1.65e86 < a < 1.75000000000000001e38

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 23.8% 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 67.2%

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

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

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

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

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

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

Developer Target 1: 86.2% 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 2024170 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))

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