Average Error: 23.1 → 5.9
Time: 28.3s
Precision: binary64
Cost: 18256
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
\[\begin{array}{l} t_1 := {\left(b - y\right)}^{2}\\ t_2 := z \cdot \left(t - a\right)\\ t_3 := \frac{x \cdot y + t_2}{y + z \cdot \left(b - y\right)}\\ t_4 := \frac{t - a}{b - y}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-245}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\frac{\frac{x \cdot y}{b - y}}{z} + \left(t_4 - \frac{y}{z} \cdot \frac{t - a}{t_1}\right)\\ \mathbf{elif}\;t_3 \leq 10^{+300}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, t_2\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_4 + \frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{t_1}}{z}\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (pow (- b y) 2.0))
        (t_2 (* z (- t a)))
        (t_3 (/ (+ (* x y) t_2) (+ y (* z (- b y)))))
        (t_4 (/ (- t a) (- b y))))
   (if (<= t_3 (- INFINITY))
     (+
      (+ (/ t (- b y)) (* (/ y z) (/ x (- b y))))
      (- (/ (- a t) (* y z)) (/ a (- b y))))
     (if (<= t_3 -2e-245)
       t_3
       (if (<= t_3 0.0)
         (+ (/ (/ (* x y) (- b y)) z) (- t_4 (* (/ y z) (/ (- t a) t_1))))
         (if (<= t_3 1e+300)
           (/ (fma y x t_2) (fma z (- b y) y))
           (if (<= t_3 INFINITY)
             (/ x (- 1.0 z))
             (+ t_4 (/ (+ (* x (/ y (- b y))) (* y (/ (- a t) t_1))) z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = pow((b - y), 2.0);
	double t_2 = z * (t - a);
	double t_3 = ((x * y) + t_2) / (y + (z * (b - y)));
	double t_4 = (t - a) / (b - y);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = ((t / (b - y)) + ((y / z) * (x / (b - y)))) + (((a - t) / (y * z)) - (a / (b - y)));
	} else if (t_3 <= -2e-245) {
		tmp = t_3;
	} else if (t_3 <= 0.0) {
		tmp = (((x * y) / (b - y)) / z) + (t_4 - ((y / z) * ((t - a) / t_1)));
	} else if (t_3 <= 1e+300) {
		tmp = fma(y, x, t_2) / fma(z, (b - y), y);
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = x / (1.0 - z);
	} else {
		tmp = t_4 + (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z);
	}
	return tmp;
}
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 code(x, y, z, t, a, b)
	t_1 = Float64(b - y) ^ 2.0
	t_2 = Float64(z * Float64(t - a))
	t_3 = Float64(Float64(Float64(x * y) + t_2) / Float64(y + Float64(z * Float64(b - y))))
	t_4 = Float64(Float64(t - a) / Float64(b - y))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64(Float64(t / Float64(b - y)) + Float64(Float64(y / z) * Float64(x / Float64(b - y)))) + Float64(Float64(Float64(a - t) / Float64(y * z)) - Float64(a / Float64(b - y))));
	elseif (t_3 <= -2e-245)
		tmp = t_3;
	elseif (t_3 <= 0.0)
		tmp = Float64(Float64(Float64(Float64(x * y) / Float64(b - y)) / z) + Float64(t_4 - Float64(Float64(y / z) * Float64(Float64(t - a) / t_1))));
	elseif (t_3 <= 1e+300)
		tmp = Float64(fma(y, x, t_2) / fma(z, Float64(b - y), y));
	elseif (t_3 <= Inf)
		tmp = Float64(x / Float64(1.0 - z));
	else
		tmp = Float64(t_4 + Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / t_1))) / z));
	end
	return tmp
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]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a - t), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -2e-245], t$95$3, If[LessEqual[t$95$3, 0.0], N[(N[(N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(t$95$4 - N[(N[(y / z), $MachinePrecision] * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+300], N[(N[(y * x + t$95$2), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{x \cdot y + t_2}{y + z \cdot \left(b - y\right)}\\
t_4 := \frac{t - a}{b - y}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\

\mathbf{elif}\;t_3 \leq -2 \cdot 10^{-245}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, t_2\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{x}{1 - z}\\

\mathbf{else}:\\
\;\;\;\;t_4 + \frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{t_1}}{z}\\


\end{array}

Error

Target

Original23.1
Target17.5
Herbie5.9
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}} \]

Derivation

  1. Split input into 6 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 64.0

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a)))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in z around inf 40.7

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

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) - \left(\frac{a}{b - y} + \frac{t - a}{{\left(b - y\right)}^{2}} \cdot \frac{y}{z}\right)} \]
      Proof
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (*.f64 (/.f64 y z) (/.f64 x (-.f64 b y)))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 6 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y)))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 3 points increase in error, 3 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (+.f64 (/.f64 a (-.f64 b y)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))))): 3 points increase in error, 3 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (+.f64 (/.f64 a (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (Rewrite=> *-commutative_binary64 (*.f64 z (pow.f64 (-.f64 b y) 2)))))): 0 points increase in error, 6 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 z (pow.f64 (-.f64 b y) 2))) (/.f64 a (-.f64 b y))))): 6 points increase in error, 0 points decrease in error
    5. Taylor expanded in b around 0 35.0

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

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

    1. Initial program 0.3

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

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

    1. Initial program 42.0

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a)))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in z around inf 21.5

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

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{b - y}}{z} + \left(\frac{t - a}{b - y} - \frac{t - a}{{\left(b - y\right)}^{2}} \cdot \frac{y}{z}\right)} \]
      Proof
      (+.f64 (/.f64 (/.f64 (*.f64 x y) (-.f64 b y)) z) (-.f64 (/.f64 (-.f64 t a) (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y x)) (-.f64 b y)) z) (-.f64 (/.f64 (-.f64 t a) (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 10 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z))) (-.f64 (/.f64 (-.f64 t a) (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 6 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z)) (-.f64 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 t (-.f64 b y)) (/.f64 a (-.f64 b y)))) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 4 points increase in error, 6 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z)) (-.f64 (-.f64 (/.f64 t (-.f64 b y)) (/.f64 a (-.f64 b y))) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))))): 0 points increase in error, 10 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z)) (Rewrite<= associate--r+_binary64 (-.f64 (/.f64 t (-.f64 b y)) (+.f64 (/.f64 a (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z)))))): 10 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (Rewrite<= *-commutative_binary64 (*.f64 z (-.f64 b y)))) (-.f64 (/.f64 t (-.f64 b y)) (+.f64 (/.f64 a (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (-.f64 (/.f64 t (-.f64 b y)) (+.f64 (/.f64 a (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (Rewrite=> *-commutative_binary64 (*.f64 z (pow.f64 (-.f64 b y) 2))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (-.f64 (/.f64 t (-.f64 b y)) (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 z (pow.f64 (-.f64 b y) 2))) (/.f64 a (-.f64 b y)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (+.f64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 z (pow.f64 (-.f64 b y) 2))) (/.f64 a (-.f64 b y))))): 0 points increase in error, 10 points decrease in error

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

    1. Initial program 0.3

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a)))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error

    if 1.0000000000000001e300 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 62.6

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a)))) (+.f64 y (*.f64 z (-.f64 b y)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in y around inf 32.8

      \[\leadsto \color{blue}{\frac{x}{-1 \cdot z + 1}} \]
    4. Simplified32.8

      \[\leadsto \color{blue}{\frac{x}{1 - z}} \]
      Proof
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (*.f64 (/.f64 y z) (/.f64 x (-.f64 b y)))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 6 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y)))) (+.f64 (/.f64 a (-.f64 b y)) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) (/.f64 y z)))): 3 points increase in error, 3 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (+.f64 (/.f64 a (-.f64 b y)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))))): 3 points increase in error, 3 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (+.f64 (/.f64 a (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (Rewrite=> *-commutative_binary64 (*.f64 z (pow.f64 (-.f64 b y) 2)))))): 0 points increase in error, 6 points decrease in error
      (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 z (pow.f64 (-.f64 b y) 2))) (/.f64 a (-.f64 b y))))): 6 points increase in error, 0 points decrease in error

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

    1. Initial program 64.0

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{y}{b - y} \cdot x - \frac{t - a}{{\left(b - y\right)}^{2}} \cdot y\right)}{z} + \frac{t - a}{b - y}} \]
      Proof
      (+.f64 (/.f64 (*.f64 1 (-.f64 (*.f64 (/.f64 y (-.f64 b y)) x) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) y))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (Rewrite<= metadata-eval (*.f64 -1 -1)) (-.f64 (*.f64 (/.f64 y (-.f64 b y)) x) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) y))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 12 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (*.f64 -1 -1) (-.f64 (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (-.f64 b y) x))) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) y))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 7 points increase in error, 5 points decrease in error
      (+.f64 (/.f64 (*.f64 (*.f64 -1 -1) (-.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 (/.f64 (-.f64 t a) (pow.f64 (-.f64 b y) 2)) y))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 5 points increase in error, 7 points decrease in error
      (+.f64 (/.f64 (*.f64 (*.f64 -1 -1) (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 t a) (/.f64 (pow.f64 (-.f64 b y) 2) y))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 12 points decrease in error
      (+.f64 (/.f64 (*.f64 (*.f64 -1 -1) (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 12 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 -1 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 -1 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 -1 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 -1 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z))) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 -1 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z)) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 t (-.f64 b y)) (/.f64 a (-.f64 b y))))): 0 points increase in error, 12 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 -1 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z)) (/.f64 t (-.f64 b y))) (/.f64 a (-.f64 b y)))): 12 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 t (-.f64 b y)) (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 -1 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z)))) (/.f64 a (-.f64 b y))): 0 points increase in error, 12 points decrease in error
  3. Recombined 6 regimes into one program.
  4. Final simplification5.9

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

Alternatives

Alternative 1
Error6.0
Cost13972
\[\begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := \frac{t - a}{b - y} + \frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{{\left(b - y\right)}^{2}}}{z}\\ t_3 := z \cdot \left(t - a\right)\\ t_4 := \frac{x \cdot y + t_3}{t_1}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;\left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\ \mathbf{elif}\;t_4 \leq -2 \cdot 10^{-245}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq 10^{+300}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_3\right)}{t_1}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error5.9
Cost13972
\[\begin{array}{l} t_1 := {\left(b - y\right)}^{2}\\ t_2 := y + z \cdot \left(b - y\right)\\ t_3 := z \cdot \left(t - a\right)\\ t_4 := \frac{x \cdot y + t_3}{t_2}\\ t_5 := \frac{t - a}{b - y}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;\left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\ \mathbf{elif}\;t_4 \leq -2 \cdot 10^{-245}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\frac{\frac{x \cdot y}{b - y}}{z} + \left(t_5 - \frac{y}{z} \cdot \frac{t - a}{t_1}\right)\\ \mathbf{elif}\;t_4 \leq 10^{+300}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_3\right)}{t_2}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_5 + \frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{t_1}}{z}\\ \end{array} \]
Alternative 3
Error8.9
Cost11984
\[\begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := z \cdot \left(t - a\right)\\ t_3 := \frac{x \cdot y + t_2}{t_1}\\ t_4 := \left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{-261}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;t_3 \leq 10^{+300}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_1}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 4
Error8.9
Cost7636
\[\begin{array}{l} t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ t_2 := \left(\frac{t}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + \left(\frac{a - t}{y \cdot z} - \frac{a}{b - y}\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-261}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{elif}\;t_1 \leq 10^{+300}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error9.0
Cost6228
\[\begin{array}{l} t_1 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-261}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 10^{+300}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error17.1
Cost1224
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.86 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{x \cdot y - z \cdot a}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-10}:\\ \;\;\;\;x + \frac{t - a}{\frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error37.0
Cost912
\[\begin{array}{l} t_1 := \frac{x}{1 - z}\\ t_2 := \frac{-a}{b - y}\\ \mathbf{if}\;a \leq -3.6 \cdot 10^{+141}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 10^{-264}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-169}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+48}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error17.1
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{-31} \lor \neg \left(z \leq 4.8 \cdot 10^{-9}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - a}{\frac{y}{z}}\\ \end{array} \]
Alternative 9
Error40.0
Cost717
\[\begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+93}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-50} \lor \neg \left(z \leq 5.8 \cdot 10^{-10}\right):\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]
Alternative 10
Error35.6
Cost716
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ \mathbf{if}\;z \leq -5 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{-51}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq 0.27:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error35.7
Cost716
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+66}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error22.9
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-74} \lor \neg \left(z \leq 1.5 \cdot 10^{-9}\right):\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]
Alternative 13
Error40.1
Cost653
\[\begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+92}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-53} \lor \neg \left(z \leq 4 \cdot 10^{-9}\right):\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 14
Error29.6
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-27} \lor \neg \left(y \leq 9.5 \cdot 10^{+32}\right):\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b}\\ \end{array} \]
Alternative 15
Error40.4
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1.86 \cdot 10^{-29}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 0.15:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 16
Error47.1
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022343 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

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