Average Error: 22.4 → 7.0
Time: 40.8s
Precision: binary64
Cost: 13896
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
\[\begin{array}{l} t_1 := \frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot \left(x + \frac{a - t}{b - y}\right)}{z}\\ \mathbf{if}\;z \leq -221.9867078486424:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.4414187103298544 \cdot 10^{-190}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, t - a, y \cdot x\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\ \mathbf{elif}\;z \leq 5.4940566573548694 \cdot 10^{-182}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 3.2390264617101976:\\ \;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y \cdot \left(1 - z\right) + z \cdot b}\\ \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
         (+
          (/ (- t a) (- b y))
          (/ (* (/ y (- b y)) (+ x (/ (- a t) (- b y)))) z))))
   (if (<= z -221.9867078486424)
     t_1
     (if (<= z -2.4414187103298544e-190)
       (/ (fma z (- t a) (* y x)) (fma z (- b y) y))
       (if (<= z 5.4940566573548694e-182)
         (+ x (/ (* z t) y))
         (if (<= z 3.2390264617101976)
           (/ (+ (* y x) (* z (- t a))) (+ (* y (- 1.0 z)) (* z b)))
           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 = ((t - a) / (b - y)) + (((y / (b - y)) * (x + ((a - t) / (b - y)))) / z);
	double tmp;
	if (z <= -221.9867078486424) {
		tmp = t_1;
	} else if (z <= -2.4414187103298544e-190) {
		tmp = fma(z, (t - a), (y * x)) / fma(z, (b - y), y);
	} else if (z <= 5.4940566573548694e-182) {
		tmp = x + ((z * t) / y);
	} else if (z <= 3.2390264617101976) {
		tmp = ((y * x) + (z * (t - a))) / ((y * (1.0 - z)) + (z * b));
	} 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(t - a) / Float64(b - y)) + Float64(Float64(Float64(y / Float64(b - y)) * Float64(x + Float64(Float64(a - t) / Float64(b - y)))) / z))
	tmp = 0.0
	if (z <= -221.9867078486424)
		tmp = t_1;
	elseif (z <= -2.4414187103298544e-190)
		tmp = Float64(fma(z, Float64(t - a), Float64(y * x)) / fma(z, Float64(b - y), y));
	elseif (z <= 5.4940566573548694e-182)
		tmp = Float64(x + Float64(Float64(z * t) / y));
	elseif (z <= 3.2390264617101976)
		tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(Float64(y * Float64(1.0 - z)) + Float64(z * b)));
	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[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision] * N[(x + N[(N[(a - t), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -221.9867078486424], t$95$1, If[LessEqual[z, -2.4414187103298544e-190], N[(N[(z * N[(t - a), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4940566573548694e-182], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2390264617101976], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot \left(x + \frac{a - t}{b - y}\right)}{z}\\
\mathbf{if}\;z \leq -221.9867078486424:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 5.4940566573548694 \cdot 10^{-182}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\

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

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


\end{array}

Error

Target

Original22.4
Target17.7
Herbie7.0
\[\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 4 regimes
  2. if z < -221.986707848642396 or 3.23902646171019759 < z

    1. Initial program 37.0

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(z, t - a, x \cdot y\right)}{\mathsf{fma}\left(z, b - y, y\right)}} \]
      Proof
      (/.f64 (fma.f64 z (-.f64 t a) (*.f64 x y)) (fma.f64 z (-.f64 b y) y)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 t a)) (*.f64 x y))) (fma.f64 z (-.f64 b y) y)): 1 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a)))) (fma.f64 z (-.f64 b y) y)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 b y)) y))): 2 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (Rewrite<= +-commutative_binary64 (+.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.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. Simplified0.6

      \[\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))): 18 points increase in error, 13 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))): 28 points increase in error, 15 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))): 34 points increase in error, 2 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))): 0 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))): 15 points increase in error, 13 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))): 2 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

    if -221.986707848642396 < z < -2.44141871032985443e-190

    1. Initial program 7.8

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

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

    if -2.44141871032985443e-190 < z < 5.4940566573548694e-182

    1. Initial program 9.9

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

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

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

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

    if 5.4940566573548694e-182 < z < 3.23902646171019759

    1. Initial program 9.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -221.9867078486424:\\ \;\;\;\;\frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot \left(x + \frac{a - t}{b - y}\right)}{z}\\ \mathbf{elif}\;z \leq -2.4414187103298544 \cdot 10^{-190}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, t - a, y \cdot x\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\ \mathbf{elif}\;z \leq 5.4940566573548694 \cdot 10^{-182}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 3.2390264617101976:\\ \;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y \cdot \left(1 - z\right) + z \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot \left(x + \frac{a - t}{b - y}\right)}{z}\\ \end{array} \]

Alternatives

Alternative 1
Error8.8
Cost5712
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ t_2 := \frac{y \cdot x + 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 -1 \cdot 10^{-246}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+282}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error9.7
Cost5712
\[\begin{array}{l} t_1 := \frac{y \cdot x + 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 + \frac{\left(\frac{a}{y} - x\right) - \frac{t}{y}}{z}\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-246}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+282}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error9.7
Cost5712
\[\begin{array}{l} t_1 := y \cdot x + z \cdot \left(t - a\right)\\ t_2 := \frac{t_1}{y + z \cdot \left(b - y\right)}\\ t_3 := \frac{t - a}{b - y}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_3 + \frac{\left(\frac{a}{y} - x\right) - \frac{t}{y}}{z}\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-246}:\\ \;\;\;\;\frac{t_1}{y \cdot \left(1 - z\right) + z \cdot b}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+282}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error7.0
Cost2128
\[\begin{array}{l} t_1 := \frac{t - a}{b - y} + \frac{\frac{y}{b - y} \cdot \left(x + \frac{a - t}{b - y}\right)}{z}\\ t_2 := y \cdot x + z \cdot \left(t - a\right)\\ \mathbf{if}\;z \leq -221.9867078486424:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.4414187103298544 \cdot 10^{-190}:\\ \;\;\;\;\frac{t_2}{y + z \cdot \left(b - y\right)}\\ \mathbf{elif}\;z \leq 5.4940566573548694 \cdot 10^{-182}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 3.2390264617101976:\\ \;\;\;\;\frac{t_2}{y \cdot \left(1 - z\right) + z \cdot b}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error21.8
Cost1360
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3932945597392757 \cdot 10^{-182}:\\ \;\;\;\;x - \frac{z \cdot a}{y}\\ \mathbf{elif}\;z \leq 6.041049893225468 \cdot 10^{-173}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 3.2390264617101976:\\ \;\;\;\;\frac{y \cdot x}{y - \left(z \cdot y - z \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error32.6
Cost1244
\[\begin{array}{l} t_1 := x - \frac{z}{\frac{y}{a}}\\ t_2 := \frac{t - a}{b}\\ \mathbf{if}\;z \leq -1.154479378796112 \cdot 10^{+287}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;\frac{-a}{b - y}\\ \mathbf{elif}\;z \leq -1.3932945597392757 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.041049893225468 \cdot 10^{-173}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.1714004648471994 \cdot 10^{+73}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.9225662487890125 \cdot 10^{+180}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error21.8
Cost1232
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3932945597392757 \cdot 10^{-182}:\\ \;\;\;\;x - \frac{z \cdot a}{y}\\ \mathbf{elif}\;z \leq 6.041049893225468 \cdot 10^{-173}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 3.2390264617101976:\\ \;\;\;\;\frac{y \cdot x}{y + z \cdot \left(b - y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error38.8
Cost980
\[\begin{array}{l} t_1 := \frac{-a}{b}\\ t_2 := \frac{a - t}{y}\\ \mathbf{if}\;z \leq -1.5039236760539951 \cdot 10^{+105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.6698520327238016 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.459767648981404 \cdot 10^{+98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.9225662487890125 \cdot 10^{+180}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error34.5
Cost980
\[\begin{array}{l} t_1 := \frac{t - a}{b}\\ \mathbf{if}\;z \leq -7.949339950692332 \cdot 10^{+286}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.1714004648471994 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.9225662487890125 \cdot 10^{+180}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error33.0
Cost980
\[\begin{array}{l} t_1 := \frac{t - a}{b}\\ \mathbf{if}\;z \leq -1.154479378796112 \cdot 10^{+287}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;\frac{-a}{b - y}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;x - \frac{z}{\frac{y}{a}}\\ \mathbf{elif}\;z \leq 5.1714004648471994 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.9225662487890125 \cdot 10^{+180}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error20.6
Cost976
\[\begin{array}{l} t_1 := x - \frac{z}{\frac{y}{a}}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.3932945597392757 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.041049893225468 \cdot 10^{-173}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error20.4
Cost976
\[\begin{array}{l} t_1 := x - \frac{z \cdot a}{y}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.3932945597392757 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.041049893225468 \cdot 10^{-173}:\\ \;\;\;\;x + \frac{z \cdot t}{y}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error30.3
Cost848
\[\begin{array}{l} t_1 := \frac{x}{1 - z}\\ \mathbf{if}\;y \leq -1.4160830804339268 \cdot 10^{-20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.618060413956905 \cdot 10^{-71}:\\ \;\;\;\;\frac{t - a}{b}\\ \mathbf{elif}\;y \leq 6.188568233900384 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.399665893492941 \cdot 10^{+86}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error36.5
Cost716
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ \mathbf{if}\;z \leq -1.5220158887387074 \cdot 10^{+174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -997028372092781.6:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error40.7
Cost520
\[\begin{array}{l} t_1 := \frac{-a}{b}\\ \mathbf{if}\;z \leq -3.1123151197896303 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.6698520327238016 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error40.3
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1.1917709396361762 \cdot 10^{-58}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 1.340271983989578 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 17
Error47.1
Cost64
\[x \]

Error

Reproduce

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