Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 66.3% → 92.8%
Time: 15.0s
Alternatives: 18
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 18 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: 66.3% 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: 92.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot x}{z}\\
\mathbf{if}\;z \leq -3400000000000:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4e12 or 13500 < z

    1. Initial program 47.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 y around inf

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot z}} \]
    4. Step-by-step derivation
      1. lower-/.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. lower--.f6418.0

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

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
    6. Taylor expanded in z around -inf

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}} \]
    8. Applied rewrites91.5%

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

      \[\leadsto \frac{\frac{x \cdot y}{b - y}}{z} + \frac{\color{blue}{t} - a}{b - y} \]
    10. Step-by-step derivation
      1. Applied rewrites99.8%

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

      if -3.4e12 < z < 13500

      1. Initial program 82.3%

        \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      2. Add Preprocessing
    11. Recombined 2 regimes into one program.
    12. Final simplification91.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3400000000000:\\ \;\;\;\;\frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot x}{z}\\ \mathbf{elif}\;z \leq 13500:\\ \;\;\;\;\frac{\left(t - a\right) \cdot z + y \cdot x}{\left(b - y\right) \cdot z + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot x}{z}\\ \end{array} \]
    13. Add Preprocessing

    Alternative 2: 73.8% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{+20}:\\ \;\;\;\;\frac{-x}{z} + t\_2\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} + x\right) - \frac{a}{y}, z, x\right)\\ \mathbf{elif}\;z \leq 12000000000000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (/ (fma t z (* y x)) (fma (- b y) z y)))
            (t_2 (/ (- t a) (- b y))))
       (if (<= z -3.4e+20)
         (+ (/ (- x) z) t_2)
         (if (<= z -4.2e-69)
           t_1
           (if (<= z 5.5e-154)
             (fma (- (+ (/ t y) x) (/ a y)) z x)
             (if (<= z 12000000000000.0) t_1 t_2))))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = fma(t, z, (y * x)) / fma((b - y), z, y);
    	double t_2 = (t - a) / (b - y);
    	double tmp;
    	if (z <= -3.4e+20) {
    		tmp = (-x / z) + t_2;
    	} else if (z <= -4.2e-69) {
    		tmp = t_1;
    	} else if (z <= 5.5e-154) {
    		tmp = fma((((t / y) + x) - (a / y)), z, x);
    	} else if (z <= 12000000000000.0) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(fma(t, z, Float64(y * x)) / fma(Float64(b - y), z, y))
    	t_2 = Float64(Float64(t - a) / Float64(b - y))
    	tmp = 0.0
    	if (z <= -3.4e+20)
    		tmp = Float64(Float64(Float64(-x) / z) + t_2);
    	elseif (z <= -4.2e-69)
    		tmp = t_1;
    	elseif (z <= 5.5e-154)
    		tmp = fma(Float64(Float64(Float64(t / y) + x) - Float64(a / y)), z, x);
    	elseif (z <= 12000000000000.0)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+20], N[(N[((-x) / z), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, -4.2e-69], t$95$1, If[LessEqual[z, 5.5e-154], N[(N[(N[(N[(t / y), $MachinePrecision] + x), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[z, 12000000000000.0], t$95$1, t$95$2]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right)}\\
    t_2 := \frac{t - a}{b - y}\\
    \mathbf{if}\;z \leq -3.4 \cdot 10^{+20}:\\
    \;\;\;\;\frac{-x}{z} + t\_2\\
    
    \mathbf{elif}\;z \leq -4.2 \cdot 10^{-69}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 5.5 \cdot 10^{-154}:\\
    \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} + x\right) - \frac{a}{y}, z, x\right)\\
    
    \mathbf{elif}\;z \leq 12000000000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -3.4e20

      1. Initial program 41.8%

        \[\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. lower-/.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. lower--.f6418.7

          \[\leadsto \frac{x}{\color{blue}{1 - z}} \]
      5. Applied rewrites18.7%

        \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
      6. Taylor expanded in z around -inf

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}} \]
      8. Applied rewrites88.9%

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

        \[\leadsto \frac{-1 \cdot x}{z} + \frac{\color{blue}{t} - a}{b - y} \]
      10. Step-by-step derivation
        1. Applied rewrites85.8%

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

        if -3.4e20 < z < -4.1999999999999999e-69 or 5.50000000000000002e-154 < z < 1.2e13

        1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

        if -4.1999999999999999e-69 < z < 5.50000000000000002e-154

        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. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.2e13 < z

          1. Initial program 44.8%

            \[\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. lower-/.f64N/A

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

              \[\leadsto \frac{\color{blue}{t - a}}{b - y} \]
            3. lower--.f6481.3

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

            \[\leadsto \color{blue}{\frac{t - a}{b - y}} \]
        8. Recombined 4 regimes into one program.
        9. 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 2024230 
        (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)))))