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

Percentage Accurate: 68.1% → 86.9%
Time: 12.9s
Alternatives: 16
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

Initial Program: 68.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.9% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e111 or 2.6000000000000001e-8 < z

    1. Initial program 38.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites87.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e111 < z < 2.6000000000000001e-8

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

Alternative 2: 38.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.79999999999999973e118 or 4.99999999999999977e-7 < z

    1. Initial program 37.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites48.5%

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

    if -6.79999999999999973e118 < z < -5.2000000000000001e-296 or 7.1999999999999998e-134 < z < 4.80000000000000026e-76

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{z}{a - z}}, x\right) \]
      5. lower--.f6442.2

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

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

      \[\leadsto \color{blue}{x + \frac{x \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{z}{a}}, x\right) \]
    11. Applied rewrites41.2%

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

    if -5.2000000000000001e-296 < z < 7.1999999999999998e-134

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
      3. lower-/.f6458.6

        \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
    10. Applied rewrites58.6%

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

    if 4.80000000000000026e-76 < z < 4.99999999999999977e-7

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{y}{\color{blue}{a - z}} \]
    10. Applied rewrites67.2%

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

Alternative 3: 46.6% accurate, 0.7× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.2e57 or 1.45000000000000011e124 < z

    1. Initial program 36.4%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites49.7%

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

    if -8.2e57 < z < 7.9999999999999997e-75

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

        \[\leadsto x - \color{blue}{\frac{x \cdot y}{a}} \]
      5. lower-*.f6451.8

        \[\leadsto x - \frac{\color{blue}{x \cdot y}}{a} \]
    8. Applied rewrites51.8%

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

    if 7.9999999999999997e-75 < z < 5.6e13

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{y}{\color{blue}{a - z}} \]
    10. Applied rewrites58.0%

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

    if 5.6e13 < z < 1.45000000000000011e124

    1. Initial program 59.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites84.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-75}:\\ \;\;\;\;x - \frac{y \cdot x}{a}\\ \mathbf{elif}\;z \leq 56000000000000:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+124}:\\ \;\;\;\;\frac{\left(y - a\right) \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 38.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.79999999999999973e118 or 3.90000000000000025e-7 < z

    1. Initial program 37.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites48.5%

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

    if -6.79999999999999973e118 < z < -5.2000000000000001e-296 or 7.1999999999999998e-134 < z < 3.90000000000000025e-7

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{z}{a - z}}, x\right) \]
      5. lower--.f6441.1

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

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

      \[\leadsto \color{blue}{x + \frac{x \cdot z}{a}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\frac{z}{a}}, x\right) \]
    11. Applied rewrites40.2%

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

    if -5.2000000000000001e-296 < z < 7.1999999999999998e-134

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
      3. lower-/.f6458.6

        \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
    10. Applied rewrites58.6%

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

Alternative 5: 86.9% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e111 or 2.6000000000000001e-8 < z

    1. Initial program 38.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites87.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e111 < z < 2.6000000000000001e-8

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.8% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.99999999999999944e118 or 1.45000000000000011e124 < z

    1. Initial program 33.4%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.6

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites54.0%

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

    if -9.99999999999999944e118 < z < 1.85e-8

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

    if 1.85e-8 < z < 1.45000000000000011e124

    1. Initial program 60.3%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.2%

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

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

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

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

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

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

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

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

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

Alternative 7: 48.5% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.79999999999999955e127 or 1.45000000000000011e124 < z

    1. Initial program 33.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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--.f6438.5

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

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{\left(x - x\right)} \]
    7. Applied rewrites54.1%

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites54.1%

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

    if -6.79999999999999955e127 < z < 4.04999999999999987e-7

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1 \cdot x}, \frac{y}{a}, x\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

    if 4.04999999999999987e-7 < z < 1.45000000000000011e124

    1. Initial program 57.9%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.3%

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

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

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

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

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

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

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

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

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

Alternative 8: 46.6% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2e57 or 4.99999999999999977e-7 < z

    1. Initial program 39.6%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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.4

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites45.6%

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

    if -8.2e57 < z < 7.9999999999999997e-75

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

        \[\leadsto x - \color{blue}{\frac{x \cdot y}{a}} \]
      5. lower-*.f6451.8

        \[\leadsto x - \frac{\color{blue}{x \cdot y}}{a} \]
    8. Applied rewrites51.8%

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

    if 7.9999999999999997e-75 < z < 4.99999999999999977e-7

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{y}{\color{blue}{a - z}} \]
    10. Applied rewrites67.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+57}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-75}:\\ \;\;\;\;x - \frac{y \cdot x}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-7}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.6% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9999999999999993e-41 or 1.90000000000000014e-8 < z

    1. Initial program 43.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites81.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999993e-41 < z < 1.90000000000000014e-8

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.0% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.20000000000000008e-39 or 1.90000000000000014e-8 < z

    1. Initial program 43.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000008e-39 < z < 1.90000000000000014e-8

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 71.7% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.20000000000000008e-39 or 2.1499999999999999e-16 < z

    1. Initial program 43.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites81.5%

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000008e-39 < z < 2.1499999999999999e-16

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 69.4% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.07999999999999996e-82 or 3.89999999999999989e-17 < z

    1. Initial program 46.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites79.2%

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

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

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

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

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

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

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

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

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

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

    if -1.07999999999999996e-82 < z < 3.89999999999999989e-17

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 68.5% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.07999999999999996e-82 or 3.89999999999999989e-17 < z

    1. Initial program 46.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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 rewrites79.2%

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

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

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

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

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

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

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

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

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

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

    if -1.07999999999999996e-82 < z < 3.89999999999999989e-17

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

Alternative 14: 35.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-75}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+50}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4500000000000001e-75 or 2.29999999999999997e50 < z

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t} \]
    9. Applied rewrites41.7%

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

    if -1.4500000000000001e-75 < z < 2.29999999999999997e50

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
      3. lower-/.f6433.5

        \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]
    10. Applied rewrites33.5%

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

Alternative 15: 25.7% accurate, 29.0× speedup?

\[\begin{array}{l} \\ t \end{array} \]
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
	return t;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = t
end function
public static double code(double x, double y, double z, double t, double a) {
	return t;
}
def code(x, y, z, t, a):
	return t
function code(x, y, z, t, a)
	return t
end
function tmp = code(x, y, z, t, a)
	tmp = t;
end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}

\\
t
\end{array}
Derivation
  1. Initial program 67.7%

    \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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--.f6417.6

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

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

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

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

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

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

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

      \[\leadsto t - \color{blue}{\left(x - x\right)} \]
  7. Applied rewrites24.1%

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

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

      \[\leadsto \color{blue}{t} \]
  9. Applied rewrites24.1%

    \[\leadsto \color{blue}{t} \]
  10. Add Preprocessing

Alternative 16: 2.8% accurate, 29.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
def code(x, y, z, t, a):
	return 0.0
function code(x, y, z, t, a)
	return 0.0
end
function tmp = code(x, y, z, t, a)
	tmp = 0.0;
end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x + -1 \cdot x} \]
  7. Step-by-step derivation
    1. distribute-rgt1-inN/A

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

      \[\leadsto \color{blue}{0} \cdot x \]
    3. mul0-lft2.9

      \[\leadsto \color{blue}{0} \]
  8. Applied rewrites2.9%

    \[\leadsto \color{blue}{0} \]
  9. Add Preprocessing

Developer Target 1: 84.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\

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


\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))

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