Average Error: 23.2 → 0.9
Time: 49.3s
Precision: binary64
Cost: 19924
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ t_3 := \mathsf{fma}\left(z, b - y, y\right)\\ t_4 := x \cdot \frac{y}{t_3} + \frac{z}{\frac{t_3}{t - a}}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{+281}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (+ (/ (* x (/ y (- b y))) z) (/ (- t a) (- b y))))
        (t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
        (t_3 (fma z (- b y) y))
        (t_4 (+ (* x (/ y t_3)) (/ z (/ t_3 (- t a))))))
   (if (<= t_2 -2e+281)
     t_4
     (if (<= t_2 -2e-291)
       t_2
       (if (<= t_2 0.0)
         t_1
         (if (<= t_2 5e+297) t_2 (if (<= t_2 INFINITY) t_4 t_1)))))))
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 = ((x * (y / (b - y))) / z) + ((t - a) / (b - y));
	double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
	double t_3 = fma(z, (b - y), y);
	double t_4 = (x * (y / t_3)) + (z / (t_3 / (t - a)));
	double tmp;
	if (t_2 <= -2e+281) {
		tmp = t_4;
	} else if (t_2 <= -2e-291) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 5e+297) {
		tmp = t_2;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_4;
	} else {
		tmp = t_1;
	}
	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(Float64(Float64(x * Float64(y / Float64(b - y))) / z) + Float64(Float64(t - a) / Float64(b - y)))
	t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y))))
	t_3 = fma(z, Float64(b - y), y)
	t_4 = Float64(Float64(x * Float64(y / t_3)) + Float64(z / Float64(t_3 / Float64(t - a))))
	tmp = 0.0
	if (t_2 <= -2e+281)
		tmp = t_4;
	elseif (t_2 <= -2e-291)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 5e+297)
		tmp = t_2;
	elseif (t_2 <= Inf)
		tmp = t_4;
	else
		tmp = t_1;
	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[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * N[(y / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t$95$3 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+281], t$95$4, If[LessEqual[t$95$2, -2e-291], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+297], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$4, t$95$1]]]]]]]]]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, b - y, y\right)\\
t_4 := x \cdot \frac{y}{t_3} + \frac{z}{\frac{t_3}{t - a}}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+281}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-291}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Target

Original23.2
Target17.9
Herbie0.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 3 regimes
  2. if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2.0000000000000001e281 or 4.9999999999999998e297 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 60.6

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

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

      \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(z, b - y, y\right)} \cdot x + z \cdot \frac{t - a}{\mathsf{fma}\left(z, b - y, y\right)}} \]
      Proof
      (+.f64 (*.f64 (/.f64 y (fma.f64 z (-.f64 b y) y)) x) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 y (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 b y)) y))) x) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 y (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 b y) z)) y)) x) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 y (Rewrite<= +-commutative_binary64 (+.f64 y (*.f64 (-.f64 b y) z)))) x) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (+.f64 y (*.f64 (-.f64 b y) z)) x))) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 42 points increase in error, 4 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z)))) (*.f64 z (/.f64 (-.f64 t a) (fma.f64 z (-.f64 b y) y)))): 37 points increase in error, 35 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (*.f64 z (/.f64 (-.f64 t a) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 b y)) y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (*.f64 z (/.f64 (-.f64 t a) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 b y) z)) y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (*.f64 z (/.f64 (-.f64 t a) (Rewrite<= +-commutative_binary64 (+.f64 y (*.f64 (-.f64 b y) z)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (*.f64 z (Rewrite=> div-sub_binary64 (-.f64 (/.f64 t (+.f64 y (*.f64 (-.f64 b y) z))) (/.f64 a (+.f64 y (*.f64 (-.f64 b y) z))))))): 0 points increase in error, 2 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 (/.f64 t (+.f64 y (*.f64 (-.f64 b y) z))) z) (*.f64 (/.f64 a (+.f64 y (*.f64 (-.f64 b y) z))) z)))): 1 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (-.f64 (Rewrite<= associate-/r/_binary64 (/.f64 t (/.f64 (+.f64 y (*.f64 (-.f64 b y) z)) z))) (*.f64 (/.f64 a (+.f64 y (*.f64 (-.f64 b y) z))) z))): 5 points increase in error, 19 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (-.f64 (/.f64 t (/.f64 (+.f64 y (*.f64 (-.f64 b y) z)) z)) (Rewrite<= associate-/r/_binary64 (/.f64 a (/.f64 (+.f64 y (*.f64 (-.f64 b y) z)) z))))): 5 points increase in error, 17 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (Rewrite<= div-sub_binary64 (/.f64 (-.f64 t a) (/.f64 (+.f64 y (*.f64 (-.f64 b y) z)) z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 y x) (+.f64 y (*.f64 (-.f64 b y) z))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 t a) z) (+.f64 y (*.f64 (-.f64 b y) z))))): 57 points increase in error, 9 points decrease in error
    4. Applied egg-rr1.8

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

    if -2.0000000000000001e281 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999992e-291 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.9999999999999998e297

    1. Initial program 0.4

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

    if -1.99999999999999992e-291 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 56.7

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

      \[\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)} \]
    3. Simplified1.8

      \[\leadsto \color{blue}{\frac{\frac{y}{b - y} \cdot \left(x - \frac{t - a}{b - y}\right)}{z} + \frac{t - a}{b - y}} \]
      Proof
      (+.f64 (/.f64 (*.f64 (/.f64 y (-.f64 b y)) (-.f64 x (/.f64 (-.f64 t a) (-.f64 b y)))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 (/.f64 y (-.f64 b y)) x) (*.f64 (/.f64 y (-.f64 b y)) (/.f64 (-.f64 t a) (-.f64 b y))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (-.f64 b y) x))) (*.f64 (/.f64 y (-.f64 b y)) (/.f64 (-.f64 t a) (-.f64 b y)))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 15 points increase in error, 16 points decrease in error
      (+.f64 (/.f64 (-.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) (-.f64 b y))) (*.f64 (/.f64 y (-.f64 b y)) (/.f64 (-.f64 t a) (-.f64 b y)))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 40 points increase in error, 13 points decrease in error
      (+.f64 (/.f64 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 y (-.f64 t a)) (*.f64 (-.f64 b y) (-.f64 b y))))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 37 points increase in error, 8 points decrease in error
      (+.f64 (/.f64 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 t a) y)) (*.f64 (-.f64 b y) (-.f64 b y)))) z) (/.f64 (-.f64 t a) (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (Rewrite<= unpow2_binary64 (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 (Rewrite<= *-lft-identity_binary64 (*.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 (Rewrite<= metadata-eval (*.f64 -1 -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 (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))))): 1 points increase in error, 0 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)))): 0 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, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1 (-.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, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (*.f64 -1 (Rewrite=> distribute-lft-out--_binary64 (*.f64 -1 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))))) z)) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (Rewrite=> associate-*r*_binary64 (*.f64 (*.f64 -1 -1) (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2))))) z)) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (*.f64 (Rewrite=> metadata-eval 1) (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z)) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (Rewrite=> *-lft-identity_binary64 (-.f64 (/.f64 (*.f64 y x) (-.f64 b y)) (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)))) z)) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (/.f64 (*.f64 y x) (-.f64 b y)) z) (/.f64 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)) z)))) (/.f64 a (-.f64 b y))): 1 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (-.f64 (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z))) (/.f64 (/.f64 (*.f64 (-.f64 t a) y) (pow.f64 (-.f64 b y) 2)) z))) (/.f64 a (-.f64 b y))): 17 points increase in error, 5 points decrease in error
      (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (-.f64 (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z)) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))))) (/.f64 a (-.f64 b y))): 7 points increase in error, 2 points decrease in error
      (-.f64 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (*.f64 y x) (*.f64 (-.f64 b y) z))) (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z)))) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (+.f64 (/.f64 t (-.f64 b y)) (/.f64 (*.f64 y x) (Rewrite=> *-commutative_binary64 (*.f64 z (-.f64 b y))))) (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y)))) (/.f64 (*.f64 (-.f64 t a) y) (*.f64 (pow.f64 (-.f64 b y) 2) z))) (/.f64 a (-.f64 b y))): 0 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (+.f64 (/.f64 (*.f64 y x) (*.f64 z (-.f64 b y))) (/.f64 t (-.f64 b y))) (/.f64 (*.f64 (-.f64 t a) y) (Rewrite<= *-commutative_binary64 (*.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--r+_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, 0 points decrease in error
    4. Taylor expanded in x around inf 15.3

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

      \[\leadsto \frac{\color{blue}{\frac{y}{b - y} \cdot x}}{z} + \frac{t - a}{b - y} \]
      Proof
      (*.f64 (/.f64 y (-.f64 b y)) x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (-.f64 b y) x))): 42 points increase in error, 51 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) (-.f64 b y))): 84 points increase in error, 38 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification0.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 -2 \cdot 10^{+281}:\\ \;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)} + \frac{z}{\frac{\mathsf{fma}\left(z, b - y, y\right)}{t - a}}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq -2 \cdot 10^{-291}:\\ \;\;\;\;\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{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ \mathbf{elif}\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \leq 5 \cdot 10^{+297}:\\ \;\;\;\;\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 \infty:\\ \;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(z, b - y, y\right)} + \frac{z}{\frac{\mathsf{fma}\left(z, b - y, y\right)}{t - a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ \end{array} \]

Alternatives

Alternative 1
Error1.1
Cost19924
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ t_3 := \mathsf{fma}\left(z, b - y, y\right)\\ t_4 := \frac{z}{\frac{t_3}{t - a}} + \frac{y}{\frac{t_3}{x}}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{+281}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error5.2
Cost8132
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+262}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error5.4
Cost5712
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+262}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error25.7
Cost1752
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ t_2 := t_1 + \frac{\frac{x}{\frac{b}{y}}}{z}\\ \mathbf{if}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.5173170251376247 \cdot 10^{-130}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.641031083870359 \cdot 10^{-116}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 0.006336479736943964:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.816742510913293 \cdot 10^{+118}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.9385085102523864 \cdot 10^{+194}:\\ \;\;\;\;\frac{y}{b - y} \cdot \frac{x}{z} - \frac{a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error25.8
Cost1752
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_1 + \frac{\frac{x}{\frac{b}{y}}}{z}\\ \mathbf{elif}\;z \leq 1.5173170251376247 \cdot 10^{-130}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.641031083870359 \cdot 10^{-116}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 0.006336479736943964:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.816742510913293 \cdot 10^{+118}:\\ \;\;\;\;t_1 + \frac{\frac{x \cdot y}{b}}{z}\\ \mathbf{elif}\;z \leq 3.9385085102523864 \cdot 10^{+194}:\\ \;\;\;\;\frac{y}{b - y} \cdot \frac{x}{z} - \frac{a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error19.0
Cost1488
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -7.150547190799206 \cdot 10^{+22}:\\ \;\;\;\;t_1 - \frac{x}{z}\\ \mathbf{elif}\;z \leq 2.9537780727788337 \cdot 10^{+31}:\\ \;\;\;\;\frac{x \cdot y - z \cdot a}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 1.816742510913293 \cdot 10^{+118}:\\ \;\;\;\;t_1 + \frac{\frac{x \cdot y}{b}}{z}\\ \mathbf{elif}\;z \leq 3.9385085102523864 \cdot 10^{+194}:\\ \;\;\;\;\frac{y}{b - y} \cdot \frac{x}{z} - \frac{a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error22.6
Cost1360
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -2.3799562904145946 \cdot 10^{+20}:\\ \;\;\;\;t_1 - \frac{x}{z}\\ \mathbf{elif}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(t - a\right) + \frac{x}{\frac{z}{y}}}{b}\\ \mathbf{elif}\;z \leq 1.5173170251376247 \cdot 10^{-130}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.641031083870359 \cdot 10^{-116}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error12.5
Cost1352
\[\begin{array}{l} t_1 := \frac{x \cdot \frac{y}{b - y}}{z} + \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 0.006336479736943964:\\ \;\;\;\;\frac{x \cdot y - z \cdot a}{y + z \cdot \left(b - y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error23.4
Cost976
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -2.3799562904145946 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.8519458263049817 \cdot 10^{-81}:\\ \;\;\;\;\frac{\left(t - a\right) + \frac{x}{\frac{z}{y}}}{b}\\ \mathbf{elif}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error22.7
Cost968
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -2.3799562904145946 \cdot 10^{+20}:\\ \;\;\;\;t_1 - \frac{x}{z}\\ \mathbf{elif}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(t - a\right) + \frac{x}{\frac{z}{y}}}{b}\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error40.3
Cost848
\[\begin{array}{l} \mathbf{if}\;z \leq -3.163327535581457 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq -2.236812820928381 \cdot 10^{-19}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq -1.2183719592090344 \cdot 10^{-23}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 12
Error40.3
Cost720
\[\begin{array}{l} \mathbf{if}\;z \leq -3.163327535581457 \cdot 10^{+38}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq -2.236812820928381 \cdot 10^{-19}:\\ \;\;\;\;\frac{-a}{b}\\ \mathbf{elif}\;z \leq -1.2183719592090344 \cdot 10^{-23}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 13
Error23.5
Cost712
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error33.6
Cost584
\[\begin{array}{l} t_1 := \frac{t - a}{b}\\ \mathbf{if}\;z \leq -1.0014965925241932 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error30.2
Cost584
\[\begin{array}{l} t_1 := \frac{x}{1 - z}\\ \mathbf{if}\;y \leq -3.693282855954836 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.43694967968969 \cdot 10^{-88}:\\ \;\;\;\;\frac{t - a}{b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error40.2
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2183719592090344 \cdot 10^{-23}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 4.476768474792788 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 17
Error47.3
Cost64
\[x \]

Error

Reproduce

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