Average Error: 23.1 → 0.7
Time: 39.3s
Precision: binary64
Cost: 33236
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
\[\begin{array}{l} t_1 := y - z \cdot \left(y - b\right)\\ t_2 := z \cdot \left(t - a\right)\\ t_3 := \frac{x \cdot y + t_2}{t_1}\\ t_4 := \mathsf{fma}\left(z, b - y, y\right)\\ t_5 := x \cdot \frac{y}{t_4} + \mathsf{fma}\left(-1, z \cdot \frac{a}{t_4}, z \cdot \frac{t}{t_4}\right)\\ t_6 := \frac{x}{z} \cdot \frac{y}{b - y} + \left(\frac{t - a}{b - y} + \frac{a - t}{\frac{z \cdot {\left(b - y\right)}^{2}}{y}}\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_3 \leq -4 \cdot 10^{-308}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_1}\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t_6\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+269}:\\ \;\;\;\;\frac{\left(z \cdot t + x \cdot y\right) - z \cdot a}{t_1}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_6\\ \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 (- y (* z (- y b))))
        (t_2 (* z (- t a)))
        (t_3 (/ (+ (* x y) t_2) t_1))
        (t_4 (fma z (- b y) y))
        (t_5 (+ (* x (/ y t_4)) (fma -1.0 (* z (/ a t_4)) (* z (/ t t_4)))))
        (t_6
         (+
          (* (/ x z) (/ y (- b y)))
          (+ (/ (- t a) (- b y)) (/ (- a t) (/ (* z (pow (- b y) 2.0)) y))))))
   (if (<= t_3 (- INFINITY))
     t_5
     (if (<= t_3 -4e-308)
       (/ (fma x y t_2) t_1)
       (if (<= t_3 0.0)
         t_6
         (if (<= t_3 5e+269)
           (/ (- (+ (* z t) (* x y)) (* z a)) t_1)
           (if (<= t_3 INFINITY) t_5 t_6)))))))
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 = y - (z * (y - b));
	double t_2 = z * (t - a);
	double t_3 = ((x * y) + t_2) / t_1;
	double t_4 = fma(z, (b - y), y);
	double t_5 = (x * (y / t_4)) + fma(-1.0, (z * (a / t_4)), (z * (t / t_4)));
	double t_6 = ((x / z) * (y / (b - y))) + (((t - a) / (b - y)) + ((a - t) / ((z * pow((b - y), 2.0)) / y)));
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_5;
	} else if (t_3 <= -4e-308) {
		tmp = fma(x, y, t_2) / t_1;
	} else if (t_3 <= 0.0) {
		tmp = t_6;
	} else if (t_3 <= 5e+269) {
		tmp = (((z * t) + (x * y)) - (z * a)) / t_1;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_5;
	} else {
		tmp = t_6;
	}
	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(y - Float64(z * Float64(y - b)))
	t_2 = Float64(z * Float64(t - a))
	t_3 = Float64(Float64(Float64(x * y) + t_2) / t_1)
	t_4 = fma(z, Float64(b - y), y)
	t_5 = Float64(Float64(x * Float64(y / t_4)) + fma(-1.0, Float64(z * Float64(a / t_4)), Float64(z * Float64(t / t_4))))
	t_6 = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(a - t) / Float64(Float64(z * (Float64(b - y) ^ 2.0)) / y))))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_5;
	elseif (t_3 <= -4e-308)
		tmp = Float64(fma(x, y, t_2) / t_1);
	elseif (t_3 <= 0.0)
		tmp = t_6;
	elseif (t_3 <= 5e+269)
		tmp = Float64(Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(z * a)) / t_1);
	elseif (t_3 <= Inf)
		tmp = t_5;
	else
		tmp = t_6;
	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[(y - N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision]), $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] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x * N[(y / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(z * N[(a / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(a - t), $MachinePrecision] / N[(N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$5, If[LessEqual[t$95$3, -4e-308], N[(N[(x * y + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 0.0], t$95$6, If[LessEqual[t$95$3, 5e+269], N[(N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$5, t$95$6]]]]]]]]]]]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
t_1 := y - z \cdot \left(y - b\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{x \cdot y + t_2}{t_1}\\
t_4 := \mathsf{fma}\left(z, b - y, y\right)\\
t_5 := x \cdot \frac{y}{t_4} + \mathsf{fma}\left(-1, z \cdot \frac{a}{t_4}, z \cdot \frac{t}{t_4}\right)\\
t_6 := \frac{x}{z} \cdot \frac{y}{b - y} + \left(\frac{t - a}{b - y} + \frac{a - t}{\frac{z \cdot {\left(b - y\right)}^{2}}{y}}\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_5\\

\mathbf{elif}\;t_3 \leq -4 \cdot 10^{-308}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_2\right)}{t_1}\\

\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;t_6\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+269}:\\
\;\;\;\;\frac{\left(z \cdot t + x \cdot y\right) - z \cdot a}{t_1}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;t_6\\


\end{array}

Error

Target

Original23.1
Target17.9
Herbie0.7
\[\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 (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 5.0000000000000002e269 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0

    1. Initial program 59.5

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

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

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

      [Start]59.5

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

      +-commutative [=>]59.5

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

      associate-+r+ [=>]59.5

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

      +-commutative [<=]59.5

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

      associate-/l* [=>]30.0

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

      +-commutative [=>]30.0

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

      *-commutative [=>]30.0

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

      fma-udef [<=]30.0

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

      associate-/r/ [=>]27.9

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

      fma-def [=>]27.9

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

      associate-/l* [=>]16.3

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

      +-commutative [=>]16.3

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

      *-commutative [=>]16.3

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

      fma-udef [<=]16.3

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

      associate-/r/ [=>]17.7

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

      associate-/l* [=>]1.5

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

      +-commutative [=>]1.5

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

      *-commutative [=>]1.5

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

      fma-udef [<=]1.5

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

      associate-/r/ [=>]2.2

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

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

    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(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}} \]
      Proof

      [Start]0.3

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

      fma-def [=>]0.3

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

    if -4.00000000000000013e-308 < (/.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.3

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

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

      [Start]56.3

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

      fma-def [=>]56.3

      \[ \frac{\color{blue}{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}}{y + z \cdot \left(b - y\right)} \]
    3. 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)} \]
    4. Simplified0.7

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

      [Start]31.6

      \[ \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) \]

      associate--l+ [=>]31.6

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

      *-commutative [<=]31.6

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

      +-commutative [=>]31.6

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

      *-commutative [<=]31.6

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

      times-frac [=>]22.8

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

      *-commutative [=>]22.8

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

      associate--r+ [=>]22.8

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

      div-sub [<=]22.8

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

      associate-/l* [=>]0.7

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

      *-commutative [=>]0.7

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

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

    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(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}} \]
      Proof

      [Start]0.3

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

      fma-def [=>]0.3

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

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

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

Alternatives

Alternative 1
Error3.6
Cost14100
\[\begin{array}{l} t_1 := y - z \cdot \left(y - b\right)\\ t_2 := \frac{x}{z} \cdot \frac{y}{b - y} + \left(\frac{t - a}{b - y} + \frac{a - t}{\frac{z \cdot {\left(b - y\right)}^{2}}{y}}\right)\\ t_3 := z \cdot \left(t - a\right)\\ t_4 := \frac{x \cdot y + t_3}{t_1}\\ t_5 := \frac{a - t}{y} - \frac{x}{z + -1}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_4 \leq -4 \cdot 10^{-308}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_3\right)}{t_1}\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+269}:\\ \;\;\;\;\frac{\left(z \cdot t + x \cdot y\right) - z \cdot a}{t_1}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error6.8
Cost9672
\[\begin{array}{l} t_1 := y - z \cdot \left(y - b\right)\\ t_2 := \frac{t - a}{b - y}\\ t_3 := z \cdot \left(t - a\right)\\ t_4 := \frac{x \cdot y + t_3}{t_1}\\ t_5 := \frac{a - t}{y} - \frac{x}{z + -1}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t_4 \leq -4 \cdot 10^{-308}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t_3\right)}{t_1}\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+269}:\\ \;\;\;\;\frac{\left(z \cdot t + x \cdot y\right) - z \cdot a}{t_1}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error6.8
Cost6484
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y - z \cdot \left(y - b\right)}\\ t_3 := \frac{a - t}{y} - \frac{x}{z + -1}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq -4 \cdot 10^{-308}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+269}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error6.8
Cost6484
\[\begin{array}{l} t_1 := y - z \cdot \left(y - b\right)\\ t_2 := \frac{t - a}{b - y}\\ t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t_1}\\ t_4 := \frac{a - t}{y} - \frac{x}{z + -1}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq -4 \cdot 10^{-308}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+269}:\\ \;\;\;\;\frac{\left(z \cdot t + x \cdot y\right) - z \cdot a}{t_1}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error34.9
Cost1836
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ t_2 := \frac{x}{1 - z}\\ t_3 := \frac{t - a}{b}\\ t_4 := \frac{-a}{b - y}\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+251}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+126}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+42}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-42}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-146}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-131}:\\ \;\;\;\;z \cdot \frac{t - a}{y}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+149}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+251}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+282}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error34.9
Cost1836
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ t_2 := \frac{x}{1 - z}\\ t_3 := \frac{t - a}{b}\\ t_4 := \frac{-a}{b - y}\\ \mathbf{if}\;z \leq -2.5 \cdot 10^{+250}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+127}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+42}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-42}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-131}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+77}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+149}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+250}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+280}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error23.0
Cost1760
\[\begin{array}{l} t_1 := \frac{\left(t + \frac{x \cdot y}{z}\right) - a}{b}\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y - y \cdot z}\\ t_3 := \frac{x}{z + -1}\\ t_4 := \frac{t - a}{b - y}\\ \mathbf{if}\;y \leq -1.04 \cdot 10^{+166}:\\ \;\;\;\;\left(t - a\right) \cdot \frac{-1}{y} - t_3\\ \mathbf{elif}\;y \leq -4.7 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-20}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{z \cdot t + x \cdot y}{y - z \cdot \left(y - b\right)}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+41}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{a - t}{y} - t_3\\ \end{array} \]
Alternative 8
Error23.9
Cost1628
\[\begin{array}{l} t_1 := \frac{\left(t + \frac{x \cdot y}{z}\right) - a}{b}\\ t_2 := \frac{t - a}{b - y}\\ t_3 := \frac{a - t}{y} - \frac{x}{z + -1}\\ \mathbf{if}\;y \leq -1.15 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-107}:\\ \;\;\;\;\frac{x \cdot y}{y - z \cdot \left(y - b\right)}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-117}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+41}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 9
Error34.7
Cost1572
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ t_2 := \frac{t - a}{b}\\ t_3 := \frac{-a}{b - y}\\ \mathbf{if}\;z \leq -9.2 \cdot 10^{+249}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{+126}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+43}:\\ \;\;\;\;\frac{a - t}{y}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+72}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+149}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+249}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+281}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error23.2
Cost1496
\[\begin{array}{l} t_1 := \frac{x}{z + -1}\\ t_2 := \frac{\left(t + \frac{x \cdot y}{z}\right) - a}{b}\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+163}:\\ \;\;\;\;\left(t - a\right) \cdot \frac{-1}{y} - t_1\\ \mathbf{elif}\;y \leq -7.4 \cdot 10^{-110}:\\ \;\;\;\;\frac{z \cdot t + x \cdot y}{y - z \cdot \left(y - b\right)}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-117}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+41}:\\ \;\;\;\;\frac{t - a}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{a - t}{y} - t_1\\ \end{array} \]
Alternative 11
Error34.7
Cost1308
\[\begin{array}{l} t_1 := \frac{t}{b - y}\\ t_2 := \frac{t - a}{b}\\ t_3 := \frac{-a}{b - y}\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+250}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+81}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+149}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+251}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+282}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error24.5
Cost1232
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-146}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-131}:\\ \;\;\;\;\frac{1}{y} \cdot \left(z \cdot \left(t - a\right)\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+48}:\\ \;\;\;\;\frac{x \cdot y}{y - z \cdot \left(y - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error24.3
Cost1232
\[\begin{array}{l} t_1 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-146}:\\ \;\;\;\;\frac{x}{1 - z}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-118}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+48}:\\ \;\;\;\;\frac{x \cdot y}{y - z \cdot \left(y - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error23.9
Cost976
\[\begin{array}{l} t_1 := \frac{x}{1 - z}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -2.5 \cdot 10^{-39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-131}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right)}{y}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error23.9
Cost976
\[\begin{array}{l} t_1 := \frac{x}{1 - z}\\ t_2 := \frac{t - a}{b - y}\\ \mathbf{if}\;z \leq -5 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-131}:\\ \;\;\;\;\frac{1}{y} \cdot \left(z \cdot \left(t - a\right)\right)\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 16
Error34.6
Cost849
\[\begin{array}{l} t_1 := \frac{t - a}{b}\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{+238}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+107}:\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{-44} \lor \neg \left(z \leq 2.05 \cdot 10^{+73}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - z}\\ \end{array} \]
Alternative 17
Error40.3
Cost652
\[\begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{-32}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-8}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+128}:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 18
Error40.3
Cost652
\[\begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{-31}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-8}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+132}:\\ \;\;\;\;\frac{-x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 19
Error34.9
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-28} \lor \neg \left(z \leq 0.00031\right):\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 20
Error35.2
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-28} \lor \neg \left(z \leq 7.8 \cdot 10^{+75}\right):\\ \;\;\;\;\frac{t}{b - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - z}\\ \end{array} \]
Alternative 21
Error40.4
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{t}{b}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{b}\\ \end{array} \]
Alternative 22
Error46.9
Cost64
\[x \]

Error

Reproduce

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