Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.9% → 94.4%
Time: 13.6s
Alternatives: 19
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 79.9% accurate, 1.0× speedup?

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

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

Alternative 1: 94.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 93.3%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

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

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

    1. Initial program 3.2%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

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

Alternative 2: 26.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 83.7%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6418.0

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified18.0%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6422.8

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr22.8%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity22.8

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr22.8%

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

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

    1. Initial program 95.7%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f642.7

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified2.7%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f642.9

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr2.9%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
      2. flip--N/A

        \[\leadsto \color{blue}{\frac{t \cdot t - \left(x - x\right) \cdot \left(x - x\right)}{t + \left(x - x\right)}} \]
      3. lift--.f64N/A

        \[\leadsto \frac{t \cdot t - \color{blue}{\left(x - x\right)} \cdot \left(x - x\right)}{t + \left(x - x\right)} \]
      4. +-inversesN/A

        \[\leadsto \frac{t \cdot t - \color{blue}{0} \cdot \left(x - x\right)}{t + \left(x - x\right)} \]
      5. lift--.f64N/A

        \[\leadsto \frac{t \cdot t - 0 \cdot \color{blue}{\left(x - x\right)}}{t + \left(x - x\right)} \]
      6. +-inversesN/A

        \[\leadsto \frac{t \cdot t - 0 \cdot \color{blue}{0}}{t + \left(x - x\right)} \]
      7. metadata-evalN/A

        \[\leadsto \frac{t \cdot t - \color{blue}{0}}{t + \left(x - x\right)} \]
      8. --rgt-identityN/A

        \[\leadsto \frac{\color{blue}{t \cdot t}}{t + \left(x - x\right)} \]
      9. lift--.f64N/A

        \[\leadsto \frac{t \cdot t}{t + \color{blue}{\left(x - x\right)}} \]
      10. +-inversesN/A

        \[\leadsto \frac{t \cdot t}{t + \color{blue}{0}} \]
      11. +-rgt-identityN/A

        \[\leadsto \frac{t \cdot t}{\color{blue}{t}} \]
      12. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t \cdot t}{t}} \]
      13. lower-*.f6427.0

        \[\leadsto \frac{\color{blue}{t \cdot t}}{t} \]
    9. Applied egg-rr27.0%

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

Alternative 3: 61.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := \mathsf{fma}\left(t - x, \frac{a}{z}, t\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+163}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-82}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+144}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (fma (- t x) (/ a z) t)))
   (if (<= z -1e+163)
     t_2
     (if (<= z -3.8e-74)
       t_1
       (if (<= z 1.22e-82)
         (fma y (/ (- t x) a) x)
         (if (<= z 3.9e+144) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = fma((t - x), (a / z), t);
	double tmp;
	if (z <= -1e+163) {
		tmp = t_2;
	} else if (z <= -3.8e-74) {
		tmp = t_1;
	} else if (z <= 1.22e-82) {
		tmp = fma(y, ((t - x) / a), x);
	} else if (z <= 3.9e+144) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	t_2 = fma(Float64(t - x), Float64(a / z), t)
	tmp = 0.0
	if (z <= -1e+163)
		tmp = t_2;
	elseif (z <= -3.8e-74)
		tmp = t_1;
	elseif (z <= 1.22e-82)
		tmp = fma(y, Float64(Float64(t - x) / a), x);
	elseif (z <= 3.9e+144)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - x), $MachinePrecision] * N[(a / z), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[z, -1e+163], t$95$2, If[LessEqual[z, -3.8e-74], t$95$1, If[LessEqual[z, 1.22e-82], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 3.9e+144], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.9999999999999994e162 or 3.90000000000000018e144 < z

    1. Initial program 62.7%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto \color{blue}{t - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    11. Step-by-step derivation
      1. sub-negN/A

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

        \[\leadsto t + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot \left(t - x\right)}{z}\right)\right)}\right)\right) \]
      3. remove-double-negN/A

        \[\leadsto t + \color{blue}{\frac{a \cdot \left(t - x\right)}{z}} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t - x\right)}{z} + t} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot a}}{z} + t \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{a}{z}} + t \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{a}{z}, t\right)} \]
      8. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, \frac{a}{z}, t\right) \]
      9. lower-/.f6473.0

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

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

    if -9.9999999999999994e162 < z < -3.7999999999999996e-74 or 1.22000000000000001e-82 < z < 3.90000000000000018e144

    1. Initial program 83.1%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{y \cdot \color{blue}{\left(t - x\right)}}{a - z} \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      6. lower-/.f6457.8

        \[\leadsto \color{blue}{\frac{t - x}{a - z}} \cdot y \]
    7. Applied egg-rr57.8%

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

    if -3.7999999999999996e-74 < z < 1.22000000000000001e-82

    1. Initial program 97.6%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{t - x}{a}}, x\right) \]
      5. lower--.f6489.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+163}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{a}{z}, t\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-82}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+144}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{a}{z}, t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 39.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.06 \cdot 10^{-151}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.99999999999999959e160 or 4.89999999999999986e143 < z

    1. Initial program 62.3%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.1

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.1%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6464.0

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr64.0%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity64.0

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr64.0%

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

    if -8.99999999999999959e160 < z < -1.06e-151

    1. Initial program 84.3%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - a}{z}} \]
      4. lower--.f6437.9

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

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

    if -1.06e-151 < z < 1.35000000000000006e-48

    1. Initial program 96.5%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{y \cdot \color{blue}{\left(t - x\right)}}{a - z} \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      6. lower-/.f6461.2

        \[\leadsto \color{blue}{\frac{t - x}{a - z}} \cdot y \]
    7. Applied egg-rr61.2%

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

      \[\leadsto \color{blue}{\frac{t - x}{a}} \cdot y \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - x}{a}} \cdot y \]
      2. lower--.f6454.4

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

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

    if 1.35000000000000006e-48 < z < 4.89999999999999986e143

    1. Initial program 89.9%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
      4. lower--.f6431.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+160}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-151}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-48}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+143}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 32.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x, \frac{y}{z}, 0\right)\\ \mathbf{if}\;z \leq -9 \cdot 10^{+160}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+142}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (fma x (/ y z) 0.0)))
   (if (<= z -9e+160)
     t
     (if (<= z -1.3e-183)
       t_1
       (if (<= z 5e-100) (/ (* y t) a) (if (<= z 2.25e+142) t_1 t))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = fma(x, (y / z), 0.0);
	double tmp;
	if (z <= -9e+160) {
		tmp = t;
	} else if (z <= -1.3e-183) {
		tmp = t_1;
	} else if (z <= 5e-100) {
		tmp = (y * t) / a;
	} else if (z <= 2.25e+142) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = fma(x, Float64(y / z), 0.0)
	tmp = 0.0
	if (z <= -9e+160)
		tmp = t;
	elseif (z <= -1.3e-183)
		tmp = t_1;
	elseif (z <= 5e-100)
		tmp = Float64(Float64(y * t) / a);
	elseif (z <= 2.25e+142)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision] + 0.0), $MachinePrecision]}, If[LessEqual[z, -9e+160], t, If[LessEqual[z, -1.3e-183], t$95$1, If[LessEqual[z, 5e-100], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 2.25e+142], t$95$1, t]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{y}{z}, 0\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+160}:\\
\;\;\;\;t\\

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

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

\mathbf{elif}\;z \leq 2.25 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.99999999999999959e160 or 2.2499999999999999e142 < z

    1. Initial program 62.3%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.1

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.1%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6464.0

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr64.0%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity64.0

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr64.0%

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

    if -8.99999999999999959e160 < z < -1.2999999999999999e-183 or 5.0000000000000001e-100 < z < 2.2499999999999999e142

    1. Initial program 86.6%

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y - z}{a - z} + 1\right)} \]
      2. distribute-rgt-inN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z}\right)\right)} \cdot x + 1 \cdot x \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z} \cdot x\right)\right)} + 1 \cdot x \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{a - z}}\right)\right) + 1 \cdot x \]
      6. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \left(y - z\right)}{a - z}}\right)\right) + 1 \cdot x \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - z\right) \cdot x}}{a - z}\right)\right) + 1 \cdot x \]
      8. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot \frac{x}{a - z}}\right)\right) + 1 \cdot x \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right)} + 1 \cdot x \]
      10. *-lft-identityN/A

        \[\leadsto \left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right) + \color{blue}{x} \]
      11. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right)} \]
      12. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right) \]
      13. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\mathsf{neg}\left(\frac{x}{a - z}\right)}, x\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \mathsf{neg}\left(\color{blue}{\frac{x}{a - z}}\right), x\right) \]
      15. lower--.f6453.8

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

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

      \[\leadsto \color{blue}{x + \frac{x \cdot \left(y - z\right)}{z}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{z}} + x \]
      3. div-subN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - \frac{z}{z}\right)} + x \]
      4. sub-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(\mathsf{neg}\left(\frac{z}{z}\right)\right)\right)} + x \]
      5. *-inversesN/A

        \[\leadsto x \cdot \left(\frac{y}{z} + \left(\mathsf{neg}\left(\color{blue}{1}\right)\right)\right) + x \]
      6. metadata-evalN/A

        \[\leadsto x \cdot \left(\frac{y}{z} + \color{blue}{-1}\right) + x \]
      7. distribute-lft-outN/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{y}{z} + x \cdot -1\right)} + x \]
      8. associate-/l*N/A

        \[\leadsto \left(\color{blue}{\frac{x \cdot y}{z}} + x \cdot -1\right) + x \]
      9. *-commutativeN/A

        \[\leadsto \left(\frac{x \cdot y}{z} + \color{blue}{-1 \cdot x}\right) + x \]
      10. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{z} + \left(-1 \cdot x + x\right)} \]
      11. distribute-lft1-inN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{\left(-1 + 1\right) \cdot x} \]
      12. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{0} \cdot x \]
      13. mul0-lftN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{0} \]
      14. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} + 0 \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, 0\right)} \]
      16. lower-/.f6431.2

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{y}{z}}, 0\right) \]
    8. Simplified31.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, 0\right)} \]

    if -1.2999999999999999e-183 < z < 5.0000000000000001e-100

    1. Initial program 98.6%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a}}, t - x, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a}} \]
      4. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    12. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
      3. lower-*.f6435.7

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

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

Alternative 6: 35.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -1.06 \cdot 10^{-154}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.99999999999999959e160 or 4.89999999999999986e143 < z

    1. Initial program 62.3%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.1

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.1%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6464.0

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr64.0%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity64.0

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr64.0%

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

    if -8.99999999999999959e160 < z < -1.06e-154

    1. Initial program 84.3%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - a}{z}} \]
      4. lower--.f6437.9

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

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

    if -1.06e-154 < z < 4.89999999999999986e143

    1. Initial program 94.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{y \cdot \color{blue}{\left(t - x\right)}}{a - z} \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot y} \]
      6. lower-/.f6460.2

        \[\leadsto \color{blue}{\frac{t - x}{a - z}} \cdot y \]
    7. Applied egg-rr60.2%

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

      \[\leadsto \color{blue}{\frac{t}{a - z}} \cdot y \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t}{a - z}} \cdot y \]
      2. lower--.f6434.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+160}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-154}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+143}:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 36.0% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.99999999999999959e160 or 4.89999999999999986e143 < z

    1. Initial program 62.3%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.1

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.1%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6464.0

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr64.0%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity64.0

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr64.0%

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

    if -8.99999999999999959e160 < z < -1.60000000000000006e-152

    1. Initial program 84.3%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y - a}{z}} \]
      4. lower--.f6437.9

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

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

    if -1.60000000000000006e-152 < z < 4.89999999999999986e143

    1. Initial program 94.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
      4. lower--.f6434.2

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

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

Alternative 8: 34.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-153}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{z}, 0\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.99999999999999959e160 or 4.89999999999999986e143 < z

    1. Initial program 62.3%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.1

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.1%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6464.0

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr64.0%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity64.0

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr64.0%

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

    if -8.99999999999999959e160 < z < -4.5e-153

    1. Initial program 84.3%

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y - z}{a - z} + 1\right)} \]
      2. distribute-rgt-inN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z}\right)\right)} \cdot x + 1 \cdot x \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z} \cdot x\right)\right)} + 1 \cdot x \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{a - z}}\right)\right) + 1 \cdot x \]
      6. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \left(y - z\right)}{a - z}}\right)\right) + 1 \cdot x \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - z\right) \cdot x}}{a - z}\right)\right) + 1 \cdot x \]
      8. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot \frac{x}{a - z}}\right)\right) + 1 \cdot x \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right)} + 1 \cdot x \]
      10. *-lft-identityN/A

        \[\leadsto \left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right) + \color{blue}{x} \]
      11. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right)} \]
      12. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right) \]
      13. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\mathsf{neg}\left(\frac{x}{a - z}\right)}, x\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \mathsf{neg}\left(\color{blue}{\frac{x}{a - z}}\right), x\right) \]
      15. lower--.f6456.7

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

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

      \[\leadsto \color{blue}{x + \frac{x \cdot \left(y - z\right)}{z}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{z}} + x \]
      3. div-subN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - \frac{z}{z}\right)} + x \]
      4. sub-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} + \left(\mathsf{neg}\left(\frac{z}{z}\right)\right)\right)} + x \]
      5. *-inversesN/A

        \[\leadsto x \cdot \left(\frac{y}{z} + \left(\mathsf{neg}\left(\color{blue}{1}\right)\right)\right) + x \]
      6. metadata-evalN/A

        \[\leadsto x \cdot \left(\frac{y}{z} + \color{blue}{-1}\right) + x \]
      7. distribute-lft-outN/A

        \[\leadsto \color{blue}{\left(x \cdot \frac{y}{z} + x \cdot -1\right)} + x \]
      8. associate-/l*N/A

        \[\leadsto \left(\color{blue}{\frac{x \cdot y}{z}} + x \cdot -1\right) + x \]
      9. *-commutativeN/A

        \[\leadsto \left(\frac{x \cdot y}{z} + \color{blue}{-1 \cdot x}\right) + x \]
      10. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{z} + \left(-1 \cdot x + x\right)} \]
      11. distribute-lft1-inN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{\left(-1 + 1\right) \cdot x} \]
      12. metadata-evalN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{0} \cdot x \]
      13. mul0-lftN/A

        \[\leadsto \frac{x \cdot y}{z} + \color{blue}{0} \]
      14. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} + 0 \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, 0\right)} \]
      16. lower-/.f6434.5

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{y}{z}}, 0\right) \]
    8. Simplified34.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \frac{y}{z}, 0\right)} \]

    if -4.5e-153 < z < 4.89999999999999986e143

    1. Initial program 94.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    4. Step-by-step derivation
      1. div-subN/A

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(t - x\right)}{a - z}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{y \cdot \left(t - x\right)}}{a - z} \]
      5. lower--.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
      3. lower-/.f64N/A

        \[\leadsto t \cdot \color{blue}{\frac{y}{a - z}} \]
      4. lower--.f6434.2

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

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

Alternative 9: 79.8% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25e-9 or 5.3000000000000002e116 < z

    1. Initial program 67.5%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

    if -1.25e-9 < z < 5.3000000000000002e116

    1. Initial program 95.2%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a - z}}, t - x, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

Alternative 10: 76.0% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000005e153 or 5.3000000000000002e116 < z

    1. Initial program 63.7%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto t - \left(t - x\right) \cdot \color{blue}{\frac{y}{z}} \]
    11. Step-by-step derivation
      1. lower-/.f6480.5

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

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

    if -1.25000000000000005e153 < z < 5.3000000000000002e116

    1. Initial program 91.9%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y}{a - z}}, t - x, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

Alternative 11: 73.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{-116}:\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t}{a - z}, x\right)\\

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

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


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

    1. Initial program 94.1%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

    if -6.5000000000000001e-116 < a < 4.8999999999999997e-110

    1. Initial program 69.6%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto t - \left(t - x\right) \cdot \color{blue}{\frac{y}{z}} \]
    11. Step-by-step derivation
      1. lower-/.f6493.7

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

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

    if 4.8999999999999997e-110 < a

    1. Initial program 87.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a}} + x \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \frac{t - x}{a}, x\right) \]
      6. lower-/.f64N/A

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

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

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

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

Alternative 12: 75.4% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.5000000000000001e-116 or 2.89999999999999996e-32 < a

    1. Initial program 92.5%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t}{a - z}}, x\right) \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

    if -6.5000000000000001e-116 < a < 2.89999999999999996e-32

    1. Initial program 72.0%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto t - \left(t - x\right) \cdot \color{blue}{\frac{y}{z}} \]
    11. Step-by-step derivation
      1. lower-/.f6483.2

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

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

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

Alternative 13: 68.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.8999999999999999e-69 or 4.8999999999999997e-110 < a

    1. Initial program 90.6%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{t - x}{a}}, x\right) \]
      5. lower--.f6469.7

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

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

    if -1.8999999999999999e-69 < a < 4.8999999999999997e-110

    1. Initial program 72.5%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto t - \left(t - x\right) \cdot \color{blue}{\frac{y}{z}} \]
    11. Step-by-step derivation
      1. lower-/.f6491.9

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

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

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

Alternative 14: 61.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, \frac{a}{z}, t\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.99999999999999937e171 or 8.00000000000000012e116 < z

    1. Initial program 63.6%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
    5. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{y - z}}{a - z} \cdot \left(t - x\right) + x \]
      2. lift--.f64N/A

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

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      4. lift-/.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      8. lift-*.f64N/A

        \[\leadsto \frac{1}{a - z} \cdot \color{blue}{\left(\left(y - z\right) \cdot \left(t - x\right)\right)} + x \]
      9. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(y - z\right) \cdot \left(t - x\right)\right)}{a - z}} + x \]
      11. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot \left(t - x\right)}}{a - z} + x \]
      12. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot \left(t - x\right)} + x \]
      14. div-invN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \frac{1}{a - z}\right)} \cdot \left(t - x\right) + x \]
      15. lift-/.f64N/A

        \[\leadsto \left(\left(y - z\right) \cdot \color{blue}{\frac{1}{a - z}}\right) \cdot \left(t - x\right) + x \]
      16. associate-*l*N/A

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{\left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right)} \]
      5. unsub-negN/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. lower--.f64N/A

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      7. distribute-rgt-out--N/A

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

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      9. lower-*.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right) \cdot \frac{y - a}{z}} \]
      10. lower--.f64N/A

        \[\leadsto t - \color{blue}{\left(t - x\right)} \cdot \frac{y - a}{z} \]
      11. lower-/.f64N/A

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

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

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

      \[\leadsto \color{blue}{t - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    11. Step-by-step derivation
      1. sub-negN/A

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

        \[\leadsto t + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot \left(t - x\right)}{z}\right)\right)}\right)\right) \]
      3. remove-double-negN/A

        \[\leadsto t + \color{blue}{\frac{a \cdot \left(t - x\right)}{z}} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t - x\right)}{z} + t} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot a}}{z} + t \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{a}{z}} + t \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{a}{z}, t\right)} \]
      8. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, \frac{a}{z}, t\right) \]
      9. lower-/.f6469.6

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

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

    if -8.99999999999999937e171 < z < 8.00000000000000012e116

    1. Initial program 90.7%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{t - x}{a}}, x\right) \]
      5. lower--.f6466.7

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

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

Alternative 15: 59.2% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.99999999999999937e171 or 8.00000000000000012e116 < z

    1. Initial program 63.6%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.0

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.0%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6462.4

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr62.4%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity62.4

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr62.4%

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

    if -8.99999999999999937e171 < z < 8.00000000000000012e116

    1. Initial program 90.7%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t - x}{a}} + x \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{t - x}{a}}, x\right) \]
      5. lower--.f6466.7

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

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

Alternative 16: 48.0% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.99999999999999937e171 or 5.3000000000000002e116 < z

    1. Initial program 63.6%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6452.0

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified52.0%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6462.4

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr62.4%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity62.4

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr62.4%

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

    if -8.99999999999999937e171 < z < 5.3000000000000002e116

    1. Initial program 90.7%

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y - z}{a - z} + 1\right)} \]
      2. distribute-rgt-inN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z}\right)\right)} \cdot x + 1 \cdot x \]
      4. distribute-lft-neg-outN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z} \cdot x\right)\right)} + 1 \cdot x \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{a - z}}\right)\right) + 1 \cdot x \]
      6. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \left(y - z\right)}{a - z}}\right)\right) + 1 \cdot x \]
      7. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - z\right) \cdot x}}{a - z}\right)\right) + 1 \cdot x \]
      8. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot \frac{x}{a - z}}\right)\right) + 1 \cdot x \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right)} + 1 \cdot x \]
      10. *-lft-identityN/A

        \[\leadsto \left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right) + \color{blue}{x} \]
      11. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right)} \]
      12. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right) \]
      13. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\mathsf{neg}\left(\frac{x}{a - z}\right)}, x\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y - z, \mathsf{neg}\left(\color{blue}{\frac{x}{a - z}}\right), x\right) \]
      15. lower--.f6459.1

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{a} + x} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x \cdot y}{a}\right)\right)} + x \]
      3. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{y}{a}}\right)\right) + x \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{y}{a}} + x \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot x\right)} \cdot \frac{y}{a} + x \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot x, \frac{y}{a}, x\right)} \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{y}{a}, x\right) \]
      8. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, \frac{y}{a}, x\right) \]
      9. lower-/.f6451.4

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

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

Alternative 17: 34.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-31}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6999999999999998e-31 or 1.35e-10 < z

    1. Initial program 73.6%

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    4. Step-by-step derivation
      1. lower--.f6429.2

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    5. Simplified29.2%

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    6. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) + x} \]
      3. lift--.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right)} + x \]
      4. associate-+l-N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      5. lower--.f64N/A

        \[\leadsto \color{blue}{t - \left(x - x\right)} \]
      6. lower--.f6437.3

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied egg-rr37.3%

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    8. Step-by-step derivation
      1. +-inversesN/A

        \[\leadsto t - \color{blue}{0} \]
      2. --rgt-identity37.3

        \[\leadsto \color{blue}{t} \]
    9. Applied egg-rr37.3%

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

    if -3.6999999999999998e-31 < z < 1.35e-10

    1. Initial program 97.1%

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

        \[\leadsto x + \color{blue}{\left(y - z\right)} \cdot \frac{t - x}{a - z} \]
      2. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{t - x}{\color{blue}{a - z}} \]
      3. lift--.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \frac{\color{blue}{t - x}}{a - z} \]
      4. div-invN/A

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      6. lift-/.f64N/A

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{t - x}{a - z}} \]
      7. lift-*.f64N/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - z}{a}}, t - x, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{t \cdot \left(y - z\right)}}{a} \]
      5. lower--.f6429.1

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    12. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
      3. lower-*.f6427.1

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
    13. Simplified27.1%

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

Alternative 18: 25.5% accurate, 29.0× speedup?

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

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

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

    \[\leadsto x + \color{blue}{\left(t - x\right)} \]
  4. Step-by-step derivation
    1. lower--.f6416.7

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
  5. Simplified16.7%

    \[\leadsto x + \color{blue}{\left(t - x\right)} \]
  6. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
    2. +-commutativeN/A

      \[\leadsto \color{blue}{\left(t - x\right) + x} \]
    3. lift--.f64N/A

      \[\leadsto \color{blue}{\left(t - x\right)} + x \]
    4. associate-+l-N/A

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    5. lower--.f64N/A

      \[\leadsto \color{blue}{t - \left(x - x\right)} \]
    6. lower--.f6421.0

      \[\leadsto t - \color{blue}{\left(x - x\right)} \]
  7. Applied egg-rr21.0%

    \[\leadsto \color{blue}{t - \left(x - x\right)} \]
  8. Step-by-step derivation
    1. +-inversesN/A

      \[\leadsto t - \color{blue}{0} \]
    2. --rgt-identity21.0

      \[\leadsto \color{blue}{t} \]
  9. Applied egg-rr21.0%

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

Alternative 19: 2.8% accurate, 29.0× speedup?

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y - z}{a - z} + 1\right)} \]
    2. distribute-rgt-inN/A

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

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z}\right)\right)} \cdot x + 1 \cdot x \]
    4. distribute-lft-neg-outN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{a - z} \cdot x\right)\right)} + 1 \cdot x \]
    5. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{a - z}}\right)\right) + 1 \cdot x \]
    6. associate-/l*N/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \left(y - z\right)}{a - z}}\right)\right) + 1 \cdot x \]
    7. *-commutativeN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\left(y - z\right) \cdot x}}{a - z}\right)\right) + 1 \cdot x \]
    8. associate-/l*N/A

      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot \frac{x}{a - z}}\right)\right) + 1 \cdot x \]
    9. distribute-rgt-neg-inN/A

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right)} + 1 \cdot x \]
    10. *-lft-identityN/A

      \[\leadsto \left(y - z\right) \cdot \left(\mathsf{neg}\left(\frac{x}{a - z}\right)\right) + \color{blue}{x} \]
    11. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right)} \]
    12. lower--.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{y - z}, \mathsf{neg}\left(\frac{x}{a - z}\right), x\right) \]
    13. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\mathsf{neg}\left(\frac{x}{a - z}\right)}, x\right) \]
    14. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(y - z, \mathsf{neg}\left(\color{blue}{\frac{x}{a - z}}\right), x\right) \]
    15. lower--.f6448.9

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

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

    \[\leadsto \color{blue}{x + -1 \cdot x} \]
  7. Step-by-step derivation
    1. distribute-rgt1-inN/A

      \[\leadsto \color{blue}{\left(-1 + 1\right) \cdot x} \]
    2. metadata-evalN/A

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

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

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

Reproduce

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