Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 65.6% → 87.1%
Time: 14.1s
Alternatives: 11
Speedup: 1.3×

Specification

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

\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\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 11 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: 65.6% accurate, 1.0× speedup?

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

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

Alternative 1: 87.1% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{z \cdot \left(t - a\right) + x \cdot y}{t\_1}\\
t_4 := \mathsf{fma}\left(z, b - y, y\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot t\_4}, \frac{y}{t\_4}\right)\\

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

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_2\\

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

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


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

    1. Initial program 26.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \color{blue}{\left(z \cdot \left(b - y\right) + y\right)}}, \frac{y}{y + z \cdot \left(b - y\right)}\right) \]
      9. accelerator-lowering-fma.f64N/A

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \mathsf{fma}\left(z, b - y, y\right)}, \frac{y}{\color{blue}{z \cdot \left(b - y\right) + y}}\right) \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \mathsf{fma}\left(z, b - y, y\right)}, \frac{y}{\color{blue}{\mathsf{fma}\left(z, b - y, y\right)}}\right) \]
      14. --lowering--.f6479.5

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000008e-222

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t - a}, z, x \cdot y\right)}{y + z \cdot \left(b - y\right)} \]
      5. *-lowering-*.f6499.6

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

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

    if -5.00000000000000008e-222 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 9.99999999999999988e254 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 20.2%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6480.5

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified80.5%

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \left(\mathsf{neg}\left(a\right)\right) + x \cdot y}{z \cdot \left(b - y\right) + y} \cdot \left(\color{blue}{{t}^{-1}} \cdot t\right) + t \cdot \frac{z}{z \cdot \left(b - y\right) + y} \]
      7. pow-plusN/A

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

        \[\leadsto \frac{z \cdot \left(\mathsf{neg}\left(a\right)\right) + x \cdot y}{z \cdot \left(b - y\right) + y} \cdot {t}^{\color{blue}{0}} + t \cdot \frac{z}{z \cdot \left(b - y\right) + y} \]
      9. metadata-evalN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z \cdot \left(\mathsf{neg}\left(a\right)\right) + x \cdot y}{z \cdot \left(b - y\right) + y}, 1, t \cdot \frac{z}{z \cdot \left(b - y\right) + y}\right)} \]
    7. Applied egg-rr99.6%

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

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

Alternative 2: 87.1% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\mathsf{fma}\left(t - a, z, x \cdot y\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{z \cdot \left(t - a\right) + x \cdot y}{t\_1}\\
t_5 := \mathsf{fma}\left(z, b - y, y\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot t\_5}, \frac{y}{t\_5}\right)\\

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

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_4 \leq 10^{+255}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 26.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \color{blue}{\left(z \cdot \left(b - y\right) + y\right)}}, \frac{y}{y + z \cdot \left(b - y\right)}\right) \]
      9. accelerator-lowering-fma.f64N/A

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \mathsf{fma}\left(z, b - y, y\right)}, \frac{y}{\color{blue}{z \cdot \left(b - y\right) + y}}\right) \]
      13. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(z, \frac{t - a}{x \cdot \mathsf{fma}\left(z, b - y, y\right)}, \frac{y}{\color{blue}{\mathsf{fma}\left(z, b - y, y\right)}}\right) \]
      14. --lowering--.f6479.5

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000008e-222 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 9.99999999999999988e254

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t - a}, z, x \cdot y\right)}{y + z \cdot \left(b - y\right)} \]
      5. *-lowering-*.f6499.5

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

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

    if -5.00000000000000008e-222 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 9.99999999999999988e254 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 20.2%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6480.5

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified80.5%

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.3%

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

Alternative 3: 84.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.80000000000000007e24 or 9e14 < z

    1. Initial program 44.1%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6485.6

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified85.6%

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

    if -8.80000000000000007e24 < z < 9e14

    1. Initial program 86.5%

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{t - a}, z, x \cdot y\right)}{y + z \cdot \left(b - y\right)} \]
      5. *-lowering-*.f6486.5

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

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

Alternative 4: 71.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.00000000000000008e-5 or 2.64999999999999982e-12 < z

    1. Initial program 47.9%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6485.4

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified85.4%

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

    if -1.00000000000000008e-5 < z < 2.64999999999999982e-12

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \left(\frac{b}{y} + \color{blue}{-1}\right), x\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \color{blue}{\left(\frac{b}{y} + -1\right)}, x\right) \]
      15. /-lowering-/.f6456.2

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

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

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

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

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

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

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

Alternative 5: 66.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4999999999999999e-6 or 5.10000000000000002e-126 < z

    1. Initial program 53.9%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6478.8

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified78.8%

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

    if -5.4999999999999999e-6 < z < 5.10000000000000002e-126

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \left(\frac{b}{y} + \color{blue}{-1}\right), x\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \color{blue}{\left(\frac{b}{y} + -1\right)}, x\right) \]
      15. /-lowering-/.f6457.8

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

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

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

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

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

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

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

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

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

Alternative 6: 67.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.50000000000000004e-5 or 3.29999999999999988e-16 < z

    1. Initial program 47.9%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6485.4

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified85.4%

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

    if -1.50000000000000004e-5 < z < 3.29999999999999988e-16

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \left(\frac{b}{y} + \color{blue}{-1}\right), x\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \color{blue}{\left(\frac{b}{y} + -1\right)}, x\right) \]
      15. /-lowering-/.f6456.2

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

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

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

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

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

Alternative 7: 64.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{-70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- t a) (- b y))))
   (if (<= z -6.6e-70) t_1 (if (<= z 3.6e-128) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (t - a) / (b - y);
	double tmp;
	if (z <= -6.6e-70) {
		tmp = t_1;
	} else if (z <= 3.6e-128) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (t - a) / (b - y)
    if (z <= (-6.6d-70)) then
        tmp = t_1
    else if (z <= 3.6d-128) then
        tmp = 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 b) {
	double t_1 = (t - a) / (b - y);
	double tmp;
	if (z <= -6.6e-70) {
		tmp = t_1;
	} else if (z <= 3.6e-128) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (t - a) / (b - y)
	tmp = 0
	if z <= -6.6e-70:
		tmp = t_1
	elif z <= 3.6e-128:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(t - a) / Float64(b - y))
	tmp = 0.0
	if (z <= -6.6e-70)
		tmp = t_1;
	elseif (z <= 3.6e-128)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (t - a) / (b - y);
	tmp = 0.0;
	if (z <= -6.6e-70)
		tmp = t_1;
	elseif (z <= 3.6e-128)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-70], t$95$1, If[LessEqual[z, 3.6e-128], x, t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-128}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.60000000000000033e-70 or 3.60000000000000025e-128 < z

    1. Initial program 57.9%

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

      \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
      2. --lowering--.f64N/A

        \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
      3. --lowering--.f6473.6

        \[\leadsto \frac{t - a}{\color{blue}{b - y}} \]
    5. Simplified73.6%

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

    if -6.60000000000000033e-70 < z < 3.60000000000000025e-128

    1. Initial program 82.7%

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

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified50.2%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 8: 53.8% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{1 - z}\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{+14}:\\ \;\;\;\;\frac{t - a}{b}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (/ x (- 1.0 z))))
       (if (<= y -2.4e+57) t_1 (if (<= y 2.35e+14) (/ (- t a) b) t_1))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = x / (1.0 - z);
    	double tmp;
    	if (y <= -2.4e+57) {
    		tmp = t_1;
    	} else if (y <= 2.35e+14) {
    		tmp = (t - a) / b;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t, a, b)
        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), intent (in) :: b
        real(8) :: t_1
        real(8) :: tmp
        t_1 = x / (1.0d0 - z)
        if (y <= (-2.4d+57)) then
            tmp = t_1
        else if (y <= 2.35d+14) then
            tmp = (t - a) / b
        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 b) {
    	double t_1 = x / (1.0 - z);
    	double tmp;
    	if (y <= -2.4e+57) {
    		tmp = t_1;
    	} else if (y <= 2.35e+14) {
    		tmp = (t - a) / b;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = x / (1.0 - z)
    	tmp = 0
    	if y <= -2.4e+57:
    		tmp = t_1
    	elif y <= 2.35e+14:
    		tmp = (t - a) / b
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(x / Float64(1.0 - z))
    	tmp = 0.0
    	if (y <= -2.4e+57)
    		tmp = t_1;
    	elseif (y <= 2.35e+14)
    		tmp = Float64(Float64(t - a) / b);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	t_1 = x / (1.0 - z);
    	tmp = 0.0;
    	if (y <= -2.4e+57)
    		tmp = t_1;
    	elseif (y <= 2.35e+14)
    		tmp = (t - a) / b;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+57], t$95$1, If[LessEqual[y, 2.35e+14], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{x}{1 - z}\\
    \mathbf{if}\;y \leq -2.4 \cdot 10^{+57}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 2.35 \cdot 10^{+14}:\\
    \;\;\;\;\frac{t - a}{b}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -2.40000000000000005e57 or 2.35e14 < y

      1. Initial program 51.3%

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

        \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
        2. mul-1-negN/A

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

          \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
        4. --lowering--.f6447.8

          \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
      5. Simplified47.8%

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

      if -2.40000000000000005e57 < y < 2.35e14

      1. Initial program 77.3%

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

        \[\leadsto \color{blue}{\frac{t - a}{b}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \color{blue}{\frac{t - a}{b}} \]
        2. --lowering--.f6456.1

          \[\leadsto \frac{\color{blue}{t - a}}{b} \]
      5. Simplified56.1%

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

    Alternative 9: 32.1% accurate, 2.6× speedup?

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
      2. mul-1-negN/A

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

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
      4. --lowering--.f6428.0

        \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
    5. Simplified28.0%

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    6. Add Preprocessing

    Alternative 10: 24.4% accurate, 5.6× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(z, x, x\right) \end{array} \]
    (FPCore (x y z t a b) :precision binary64 (fma z x x))
    double code(double x, double y, double z, double t, double a, double b) {
    	return fma(z, x, x);
    }
    
    function code(x, y, z, t, a, b)
    	return fma(z, x, x)
    end
    
    code[x_, y_, z_, t_, a_, b_] := N[(z * x + x), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(z, x, x\right)
    \end{array}
    
    Derivation
    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \left(\frac{b}{y} + \color{blue}{-1}\right), x\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{y} - x \cdot \color{blue}{\left(\frac{b}{y} + -1\right)}, x\right) \]
      15. /-lowering-/.f6431.1

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

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
    7. Step-by-step derivation
      1. Simplified22.7%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
      2. Add Preprocessing

      Alternative 11: 24.2% accurate, 39.0× speedup?

      \[\begin{array}{l} \\ x \end{array} \]
      (FPCore (x y z t a b) :precision binary64 x)
      double code(double x, double y, double z, double t, double a, double b) {
      	return x;
      }
      
      real(8) function code(x, y, z, t, a, b)
          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), intent (in) :: b
          code = x
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return x;
      }
      
      def code(x, y, z, t, a, b):
      	return x
      
      function code(x, y, z, t, a, b)
      	return x
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = x;
      end
      
      code[x_, y_, z_, t_, a_, b_] := x
      
      \begin{array}{l}
      
      \\
      x
      \end{array}
      
      Derivation
      1. Initial program 66.4%

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

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified22.6%

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

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

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

        Reproduce

        ?
        herbie shell --seed 2024204 
        (FPCore (x y z t a b)
          :name "Development.Shake.Progress:decay from shake-0.15.5"
          :precision binary64
        
          :alt
          (! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
        
          (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))