Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.0% → 90.8%
Time: 11.2s
Alternatives: 13
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 13 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: 80.0% 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: 90.8% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 91.6%

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

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

    1. Initial program 11.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 \color{blue}{\frac{t - x}{a - z}} \]
      3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(\left(t + x\right) \cdot \left(t - x\right)\right)}{\left(a - z\right) \cdot \left(t + x\right)}} \]
    5. 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}} \]
    6. 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. div-subN/A

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

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

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

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

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

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

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

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

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

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

    1. Initial program 89.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 \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(t - x\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      11. sub-negN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      13. associate--r+N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} - t}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      15. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a - z\right)}}, y - z, x\right) \]
      19. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a + \left(\mathsf{neg}\left(z\right)\right)\right)}}, y - z, x\right) \]
      20. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + a\right)}}, y - z, x\right) \]
      21. associate--r+N/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - a}}, y - z, x\right) \]
      22. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - a}, y - z, x\right) \]
      23. remove-double-negN/A

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

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

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

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

Alternative 2: 90.8% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 90.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 \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(t - x\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      11. sub-negN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      13. associate--r+N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} - t}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      15. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a - z\right)}}, y - z, x\right) \]
      19. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a + \left(\mathsf{neg}\left(z\right)\right)\right)}}, y - z, x\right) \]
      20. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + a\right)}}, y - z, x\right) \]
      21. associate--r+N/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - a}}, y - z, x\right) \]
      22. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - a}, y - z, x\right) \]
      23. remove-double-negN/A

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

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

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

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

    1. Initial program 11.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 \color{blue}{\frac{t - x}{a - z}} \]
      3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{\left(y - z\right) \cdot \left(\left(t + x\right) \cdot \left(t - x\right)\right)}{\left(a - z\right) \cdot \left(t + x\right)}} \]
    5. 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}} \]
    6. 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. div-subN/A

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

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

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

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

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

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

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

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

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

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

Alternative 3: 28.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left(t - x\right) + x\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 3 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.4999999999999998e-187 or 4.05e15 < t < 3e124

    1. Initial program 88.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--.f6437.0

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

      \[\leadsto x + \color{blue}{\left(t - x\right)} \]

    if -2.4999999999999998e-187 < t < 4.05e15

    1. Initial program 70.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. 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}} \]
    4. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

      if 3e124 < t

      1. Initial program 90.1%

        \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 76.5% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\ \mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (fma (/ (- y z) a) (- t x) x)))
         (if (<= a -3e+54)
           t_1
           (if (<= a 9.5e-38) (fma (/ (- y a) z) (- x t) t) t_1))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = fma(((y - z) / a), (t - x), x);
      	double tmp;
      	if (a <= -3e+54) {
      		tmp = t_1;
      	} else if (a <= 9.5e-38) {
      		tmp = fma(((y - a) / z), (x - t), t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a)
      	t_1 = fma(Float64(Float64(y - z) / a), Float64(t - x), x)
      	tmp = 0.0
      	if (a <= -3e+54)
      		tmp = t_1;
      	elseif (a <= 9.5e-38)
      		tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -3e+54], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
      \mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -2.9999999999999999e54 or 9.5000000000000009e-38 < a

        1. Initial program 92.4%

          \[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. associate-/l*N/A

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

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

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

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

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

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

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

        if -2.9999999999999999e54 < a < 9.5000000000000009e-38

        1. Initial program 73.7%

          \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
        2. Add Preprocessing
        3. 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}} \]
        4. 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. +-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(t, -1, x\right), \frac{y - a}{z}, t\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites83.3%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 5: 72.0% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\ \mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (let* ((t_1 (fma (/ (- t x) a) y x)))
           (if (<= a -3e+54)
             t_1
             (if (<= a 1.85e-36) (fma (/ (- y a) z) (- x t) t) t_1))))
        double code(double x, double y, double z, double t, double a) {
        	double t_1 = fma(((t - x) / a), y, x);
        	double tmp;
        	if (a <= -3e+54) {
        		tmp = t_1;
        	} else if (a <= 1.85e-36) {
        		tmp = fma(((y - a) / z), (x - t), t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	t_1 = fma(Float64(Float64(t - x) / a), y, x)
        	tmp = 0.0
        	if (a <= -3e+54)
        		tmp = t_1;
        	elseif (a <= 1.85e-36)
        		tmp = fma(Float64(Float64(y - a) / z), Float64(x - t), t);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -3e+54], t$95$1, If[LessEqual[a, 1.85e-36], N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * N[(x - t), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
        \mathbf{if}\;a \leq -3 \cdot 10^{+54}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \leq 1.85 \cdot 10^{-36}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -2.9999999999999999e54 or 1.85000000000000001e-36 < a

          1. Initial program 92.4%

            \[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. *-commutativeN/A

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

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

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

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

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

          if -2.9999999999999999e54 < a < 1.85000000000000001e-36

          1. Initial program 73.7%

            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
          2. Add Preprocessing
          3. 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}} \]
          4. 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. +-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(t, -1, x\right), \frac{y - a}{z}, t\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites83.3%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - a}{z}, x - t, t\right)} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 6: 69.0% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (fma (/ (- t x) a) y x)))
             (if (<= a -6.6e+56) t_1 (if (<= a 9.5e-38) (fma (/ (- x t) z) y t) t_1))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = fma(((t - x) / a), y, x);
          	double tmp;
          	if (a <= -6.6e+56) {
          		tmp = t_1;
          	} else if (a <= 9.5e-38) {
          		tmp = fma(((x - t) / z), y, t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a)
          	t_1 = fma(Float64(Float64(t - x) / a), y, x)
          	tmp = 0.0
          	if (a <= -6.6e+56)
          		tmp = t_1;
          	elseif (a <= 9.5e-38)
          		tmp = fma(Float64(Float64(x - t) / z), y, t);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
          \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if a < -6.60000000000000004e56 or 9.5000000000000009e-38 < a

            1. Initial program 92.4%

              \[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. *-commutativeN/A

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

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

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

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

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

            if -6.60000000000000004e56 < a < 9.5000000000000009e-38

            1. Initial program 73.9%

              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
            2. Add Preprocessing
            3. 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}} \]
            4. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, \color{blue}{y}, t\right) \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 7: 69.5% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (let* ((t_1 (fma (/ y a) (- t x) x)))
               (if (<= a -6.6e+56) t_1 (if (<= a 9.5e-38) (fma (/ (- x t) z) y t) t_1))))
            double code(double x, double y, double z, double t, double a) {
            	double t_1 = fma((y / a), (t - x), x);
            	double tmp;
            	if (a <= -6.6e+56) {
            		tmp = t_1;
            	} else if (a <= 9.5e-38) {
            		tmp = fma(((x - t) / z), y, t);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	t_1 = fma(Float64(y / a), Float64(t - x), x)
            	tmp = 0.0
            	if (a <= -6.6e+56)
            		tmp = t_1;
            	elseif (a <= 9.5e-38)
            		tmp = fma(Float64(Float64(x - t) / z), y, t);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 9.5e-38], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
            \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;a \leq 9.5 \cdot 10^{-38}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -6.60000000000000004e56 or 9.5000000000000009e-38 < a

              1. Initial program 92.4%

                \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

                if -6.60000000000000004e56 < a < 9.5000000000000009e-38

                1. Initial program 73.9%

                  \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                2. Add Preprocessing
                3. 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}} \]
                4. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, \color{blue}{y}, t\right) \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 8: 61.5% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\ \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{+144}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t a)
                 :precision binary64
                 (let* ((t_1 (fma (/ y a) (- x) x)))
                   (if (<= a -6.6e+56) t_1 (if (<= a 2.45e+144) (fma (/ (- x t) z) y t) t_1))))
                double code(double x, double y, double z, double t, double a) {
                	double t_1 = fma((y / a), -x, x);
                	double tmp;
                	if (a <= -6.6e+56) {
                		tmp = t_1;
                	} else if (a <= 2.45e+144) {
                		tmp = fma(((x - t) / z), y, t);
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a)
                	t_1 = fma(Float64(y / a), Float64(-x), x)
                	tmp = 0.0
                	if (a <= -6.6e+56)
                		tmp = t_1;
                	elseif (a <= 2.45e+144)
                		tmp = fma(Float64(Float64(x - t) / z), y, t);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision]}, If[LessEqual[a, -6.6e+56], t$95$1, If[LessEqual[a, 2.45e+144], N[(N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision] * y + t), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
                \mathbf{if}\;a \leq -6.6 \cdot 10^{+56}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;a \leq 2.45 \cdot 10^{+144}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if a < -6.60000000000000004e56 or 2.45e144 < a

                  1. Initial program 92.4%

                    \[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. associate-/l*N/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{y - z}{a}, -1 \cdot \color{blue}{x}, x\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites56.9%

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

                      \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{x}, x\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites57.1%

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

                      if -6.60000000000000004e56 < a < 2.45e144

                      1. Initial program 77.2%

                        \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                      2. Add Preprocessing
                      3. 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}} \]
                      4. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{x - t}{z}, \color{blue}{y}, t\right) \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 9: 44.1% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) + x\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+38}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                      (FPCore (x y z t a)
                       :precision binary64
                       (let* ((t_1 (+ (- t x) x)))
                         (if (<= z -1.7e+91) t_1 (if (<= z 6.5e+38) (fma (/ y a) (- x) x) t_1))))
                      double code(double x, double y, double z, double t, double a) {
                      	double t_1 = (t - x) + x;
                      	double tmp;
                      	if (z <= -1.7e+91) {
                      		tmp = t_1;
                      	} else if (z <= 6.5e+38) {
                      		tmp = fma((y / a), -x, x);
                      	} else {
                      		tmp = t_1;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a)
                      	t_1 = Float64(Float64(t - x) + x)
                      	tmp = 0.0
                      	if (z <= -1.7e+91)
                      		tmp = t_1;
                      	elseif (z <= 6.5e+38)
                      		tmp = fma(Float64(y / a), Float64(-x), x);
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.7e+91], t$95$1, If[LessEqual[z, 6.5e+38], N[(N[(y / a), $MachinePrecision] * (-x) + x), $MachinePrecision], t$95$1]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \left(t - x\right) + x\\
                      \mathbf{if}\;z \leq -1.7 \cdot 10^{+91}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;z \leq 6.5 \cdot 10^{+38}:\\
                      \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, -x, x\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -1.7e91 or 6.5e38 < z

                        1. Initial program 66.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--.f6445.7

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

                          \[\leadsto x + \color{blue}{\left(t - x\right)} \]

                        if -1.7e91 < z < 6.5e38

                        1. Initial program 92.7%

                          \[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. associate-/l*N/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{y - z}{a}, -1 \cdot \color{blue}{x}, x\right) \]
                        7. Step-by-step derivation
                          1. Applied rewrites49.3%

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

                            \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{x}, x\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites49.2%

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

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

                          Alternative 10: 30.7% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - a}{z} \cdot x\\ \mathbf{if}\;x \leq -12.6:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{+86}:\\ \;\;\;\;\left(t - x\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (let* ((t_1 (* (/ (- y a) z) x)))
                             (if (<= x -12.6) t_1 (if (<= x 1.55e+86) (+ (- t x) x) t_1))))
                          double code(double x, double y, double z, double t, double a) {
                          	double t_1 = ((y - a) / z) * x;
                          	double tmp;
                          	if (x <= -12.6) {
                          		tmp = t_1;
                          	} else if (x <= 1.55e+86) {
                          		tmp = (t - x) + x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z, t, a)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8) :: t_1
                              real(8) :: tmp
                              t_1 = ((y - a) / z) * x
                              if (x <= (-12.6d0)) then
                                  tmp = t_1
                              else if (x <= 1.55d+86) then
                                  tmp = (t - x) + x
                              else
                                  tmp = t_1
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double t_1 = ((y - a) / z) * x;
                          	double tmp;
                          	if (x <= -12.6) {
                          		tmp = t_1;
                          	} else if (x <= 1.55e+86) {
                          		tmp = (t - x) + x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	t_1 = ((y - a) / z) * x
                          	tmp = 0
                          	if x <= -12.6:
                          		tmp = t_1
                          	elif x <= 1.55e+86:
                          		tmp = (t - x) + x
                          	else:
                          		tmp = t_1
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	t_1 = Float64(Float64(Float64(y - a) / z) * x)
                          	tmp = 0.0
                          	if (x <= -12.6)
                          		tmp = t_1;
                          	elseif (x <= 1.55e+86)
                          		tmp = Float64(Float64(t - x) + x);
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	t_1 = ((y - a) / z) * x;
                          	tmp = 0.0;
                          	if (x <= -12.6)
                          		tmp = t_1;
                          	elseif (x <= 1.55e+86)
                          		tmp = (t - x) + x;
                          	else
                          		tmp = t_1;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -12.6], t$95$1, If[LessEqual[x, 1.55e+86], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := \frac{y - a}{z} \cdot x\\
                          \mathbf{if}\;x \leq -12.6:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;x \leq 1.55 \cdot 10^{+86}:\\
                          \;\;\;\;\left(t - x\right) + x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -12.5999999999999996 or 1.5500000000000001e86 < x

                            1. Initial program 77.4%

                              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                            2. Add Preprocessing
                            3. 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}} \]
                            4. 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. +-commutativeN/A

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites43.8%

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

                              if -12.5999999999999996 < x < 1.5500000000000001e86

                              1. Initial program 84.5%

                                \[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--.f6434.4

                                  \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                              5. Applied rewrites34.4%

                                \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification37.9%

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

                            Alternative 11: 26.8% accurate, 1.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} \cdot x\\ \mathbf{if}\;y \leq -4.2 \cdot 10^{+44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+99}:\\ \;\;\;\;\left(t - x\right) + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (let* ((t_1 (* (/ y z) x)))
                               (if (<= y -4.2e+44) t_1 (if (<= y 2.9e+99) (+ (- t x) x) t_1))))
                            double code(double x, double y, double z, double t, double a) {
                            	double t_1 = (y / z) * x;
                            	double tmp;
                            	if (y <= -4.2e+44) {
                            		tmp = t_1;
                            	} else if (y <= 2.9e+99) {
                            		tmp = (t - x) + x;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(x, y, z, t, a)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8), intent (in) :: a
                                real(8) :: t_1
                                real(8) :: tmp
                                t_1 = (y / z) * x
                                if (y <= (-4.2d+44)) then
                                    tmp = t_1
                                else if (y <= 2.9d+99) then
                                    tmp = (t - x) + x
                                else
                                    tmp = t_1
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	double t_1 = (y / z) * x;
                            	double tmp;
                            	if (y <= -4.2e+44) {
                            		tmp = t_1;
                            	} else if (y <= 2.9e+99) {
                            		tmp = (t - x) + x;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a):
                            	t_1 = (y / z) * x
                            	tmp = 0
                            	if y <= -4.2e+44:
                            		tmp = t_1
                            	elif y <= 2.9e+99:
                            		tmp = (t - x) + x
                            	else:
                            		tmp = t_1
                            	return tmp
                            
                            function code(x, y, z, t, a)
                            	t_1 = Float64(Float64(y / z) * x)
                            	tmp = 0.0
                            	if (y <= -4.2e+44)
                            		tmp = t_1;
                            	elseif (y <= 2.9e+99)
                            		tmp = Float64(Float64(t - x) + x);
                            	else
                            		tmp = t_1;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a)
                            	t_1 = (y / z) * x;
                            	tmp = 0.0;
                            	if (y <= -4.2e+44)
                            		tmp = t_1;
                            	elseif (y <= 2.9e+99)
                            		tmp = (t - x) + x;
                            	else
                            		tmp = t_1;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4.2e+44], t$95$1, If[LessEqual[y, 2.9e+99], N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \frac{y}{z} \cdot x\\
                            \mathbf{if}\;y \leq -4.2 \cdot 10^{+44}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;y \leq 2.9 \cdot 10^{+99}:\\
                            \;\;\;\;\left(t - x\right) + x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if y < -4.19999999999999974e44 or 2.9000000000000002e99 < y

                              1. Initial program 86.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 \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
                                2. +-commutativeN/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(t - x\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
                                11. sub-negN/A

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

                                  \[\leadsto \mathsf{fma}\left(\frac{0 - \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
                                13. associate--r+N/A

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

                                  \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} - t}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
                                15. remove-double-negN/A

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a - z\right)}}, y - z, x\right) \]
                                19. sub-negN/A

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(a + \left(\mathsf{neg}\left(z\right)\right)\right)}}, y - z, x\right) \]
                                20. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + a\right)}}, y - z, x\right) \]
                                21. associate--r+N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - a}}, y - z, x\right) \]
                                22. neg-sub0N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{x - t}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - a}, y - z, x\right) \]
                                23. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot y}{z} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites42.1%

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

                                  if -4.19999999999999974e44 < y < 2.9000000000000002e99

                                  1. Initial program 79.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--.f6431.6

                                      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                                  5. Applied rewrites31.6%

                                    \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                                4. Recombined 2 regimes into one program.
                                5. Final simplification35.3%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+99}:\\ \;\;\;\;\left(t - x\right) + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \end{array} \]
                                6. Add Preprocessing

                                Alternative 12: 19.1% accurate, 4.1× speedup?

                                \[\begin{array}{l} \\ \left(t - x\right) + x \end{array} \]
                                (FPCore (x y z t a) :precision binary64 (+ (- t x) x))
                                double code(double x, double y, double z, double t, double a) {
                                	return (t - x) + x;
                                }
                                
                                real(8) function code(x, y, z, t, a)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8), intent (in) :: a
                                    code = (t - x) + x
                                end function
                                
                                public static double code(double x, double y, double z, double t, double a) {
                                	return (t - x) + x;
                                }
                                
                                def code(x, y, z, t, a):
                                	return (t - x) + x
                                
                                function code(x, y, z, t, a)
                                	return Float64(Float64(t - x) + x)
                                end
                                
                                function tmp = code(x, y, z, t, a)
                                	tmp = (t - x) + x;
                                end
                                
                                code[x_, y_, z_, t_, a_] := N[(N[(t - x), $MachinePrecision] + x), $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                \left(t - x\right) + x
                                \end{array}
                                
                                Derivation
                                1. Initial program 81.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--.f6425.0

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

                                  \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                                6. Final simplification25.0%

                                  \[\leadsto \left(t - x\right) + x \]
                                7. Add Preprocessing

                                Alternative 13: 2.8% accurate, 4.8× speedup?

                                \[\begin{array}{l} \\ \left(-x\right) + x \end{array} \]
                                (FPCore (x y z t a) :precision binary64 (+ (- x) x))
                                double code(double x, double y, double z, double t, double a) {
                                	return -x + x;
                                }
                                
                                real(8) function code(x, y, z, t, a)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8), intent (in) :: a
                                    code = -x + x
                                end function
                                
                                public static double code(double x, double y, double z, double t, double a) {
                                	return -x + x;
                                }
                                
                                def code(x, y, z, t, a):
                                	return -x + x
                                
                                function code(x, y, z, t, a)
                                	return Float64(Float64(-x) + x)
                                end
                                
                                function tmp = code(x, y, z, t, a)
                                	tmp = -x + x;
                                end
                                
                                code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
                                
                                \begin{array}{l}
                                
                                \\
                                \left(-x\right) + x
                                \end{array}
                                
                                Derivation
                                1. Initial program 81.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--.f6425.0

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

                                  \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                                6. Taylor expanded in t around 0

                                  \[\leadsto x + -1 \cdot \color{blue}{x} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites3.0%

                                    \[\leadsto x + \left(-x\right) \]
                                  2. Final simplification3.0%

                                    \[\leadsto \left(-x\right) + x \]
                                  3. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2024268 
                                  (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)))))