Average Error: 16.3 → 8.0
Time: 11.8s
Precision: binary64
Cost: 7368
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
\[\begin{array}{l} \mathbf{if}\;a \leq 10^{-279}:\\ \;\;\;\;x + \left(y + \frac{y}{\frac{t - a}{z - t}}\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(y, \frac{z - t}{t - a}, y\right)\\ \end{array} \]
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= a 1e-279)
   (+ x (+ y (/ y (/ (- t a) (- z t)))))
   (if (<= a 5e-28)
     (+ x (* (/ y t) (- z a)))
     (+ x (fma y (/ (- z t) (- t a)) y)))))
double code(double x, double y, double z, double t, double a) {
	return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= 1e-279) {
		tmp = x + (y + (y / ((t - a) / (z - t))));
	} else if (a <= 5e-28) {
		tmp = x + ((y / t) * (z - a));
	} else {
		tmp = x + fma(y, ((z - t) / (t - a)), y);
	}
	return tmp;
}
function code(x, y, z, t, a)
	return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t)))
end
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= 1e-279)
		tmp = Float64(x + Float64(y + Float64(y / Float64(Float64(t - a) / Float64(z - t)))));
	elseif (a <= 5e-28)
		tmp = Float64(x + Float64(Float64(y / t) * Float64(z - a)));
	else
		tmp = Float64(x + fma(y, Float64(Float64(z - t) / Float64(t - a)), y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1e-279], N[(x + N[(y + N[(y / N[(N[(t - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-28], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \leq 10^{-279}:\\
\;\;\;\;x + \left(y + \frac{y}{\frac{t - a}{z - t}}\right)\\

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

\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(y, \frac{z - t}{t - a}, y\right)\\


\end{array}

Error

Target

Original16.3
Target8.0
Herbie8.0
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < -1.3664970889390727 \cdot 10^{-7}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < 1.4754293444577233 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if a < 1.00000000000000006e-279

    1. Initial program 16.9

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(y, \frac{z - t}{t - a}, y\right)} \]
      Proof
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (-.f64 t a)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 t a)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (-.f64 t a))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= associate-/r/_binary64 (/.f64 -1 (/.f64 -1 (-.f64 t a))))) y)): 11 points increase in error, 6 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 -1 (-.f64 t a)) -1))) y)): 6 points increase in error, 11 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 t a))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 t a))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 t) a)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 t)) a) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 a (neg.f64 t))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 a t)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite=> associate-/r/_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 a t)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite<= *-commutative_binary64 (*.f64 -1 (/.f64 (-.f64 z t) (-.f64 a t)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (-.f64 z t) (-.f64 a t)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= fma-def_binary64 (+.f64 (*.f64 y (neg.f64 (/.f64 (-.f64 z t) (-.f64 a t)))) y))): 3 points increase in error, 4 points decrease in error
      (+.f64 x (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 a t)) y))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (neg.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))) y)): 59 points increase in error, 9 points decrease in error
      (+.f64 x (Rewrite<= +-commutative_binary64 (+.f64 y (neg.f64 (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= sub-neg_binary64 (-.f64 y (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))): 17 points increase in error, 5 points decrease in error
    3. Taylor expanded in y around 0 8.1

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

      \[\leadsto x + \color{blue}{\left(y + \frac{y}{\frac{t - a}{z - t}}\right)} \]
      Proof
      (+.f64 y (/.f64 y (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 y)) (/.f64 y (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 y 1)) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (*.f64 y (Rewrite<= metadata-eval (*.f64 -1 -1))) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y -1) -1)) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 y)) -1) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (Rewrite=> associate-*l*_binary64 (*.f64 -1 (*.f64 y -1))) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (/.f64 (*.f64 -1 (Rewrite<= *-commutative_binary64 (*.f64 -1 y))) (/.f64 (-.f64 t a) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 -1 (/.f64 (-.f64 t a) (-.f64 z t))) (*.f64 -1 y)))): 16 points increase in error, 7 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 -1 (-.f64 z t)) (-.f64 t a))) (*.f64 -1 y))): 3 points increase in error, 12 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 z t) (-.f64 t a)))) (*.f64 -1 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) -1)) (*.f64 -1 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (Rewrite=> associate-*l*_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (*.f64 -1 (*.f64 -1 y))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (*.f64 -1 (Rewrite=> *-commutative_binary64 (*.f64 y -1))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 -1 y) -1)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 y -1)) -1))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (Rewrite=> associate-*l*_binary64 (*.f64 y (*.f64 -1 -1))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (*.f64 y (Rewrite=> metadata-eval 1)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 1 y) (*.f64 (/.f64 (-.f64 z t) (-.f64 t a)) (Rewrite=> *-rgt-identity_binary64 y))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> distribute-rgt-out_binary64 (*.f64 y (+.f64 1 (/.f64 (-.f64 z t) (-.f64 t a))))): 7 points increase in error, 6 points decrease in error
      (*.f64 y (+.f64 1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 z (-.f64 t a)) (/.f64 t (-.f64 t a)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 y (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 1 (/.f64 z (-.f64 t a))) (/.f64 t (-.f64 t a))))): 1 points increase in error, 2 points decrease in error

    if 1.00000000000000006e-279 < a < 5.0000000000000002e-28

    1. Initial program 18.4

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

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

      \[\leadsto \color{blue}{\frac{y}{t} \cdot \left(z - a\right) + x} \]
      Proof
      (+.f64 (*.f64 (/.f64 y t) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 t (-.f64 z a)))) x): 27 points increase in error, 23 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z a)) t)) x): 35 points increase in error, 29 points decrease in error
      (+.f64 (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y z) (*.f64 y a))) t) x): 2 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (/.f64 (-.f64 (*.f64 y z) (*.f64 y a)) t)))) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (neg.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 y z) (*.f64 y a)) t)))) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (*.f64 -1 (/.f64 (-.f64 (*.f64 y z) (*.f64 y a)) t)))) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1 (-.f64 (*.f64 y z) (*.f64 y a))) t))) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (*.f64 y z)) (*.f64 -1 (*.f64 y a)))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (Rewrite=> cancel-sign-sub-inv_binary64 (+.f64 (*.f64 -1 (*.f64 y z)) (*.f64 (neg.f64 -1) (*.f64 y a)))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (+.f64 (*.f64 -1 (*.f64 y z)) (*.f64 (Rewrite=> metadata-eval 1) (*.f64 y a))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (+.f64 (*.f64 -1 (*.f64 y z)) (Rewrite=> *-lft-identity_binary64 (*.f64 y a))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 y a) (*.f64 -1 (*.f64 y z)))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (+.f64 (*.f64 y a) (Rewrite=> mul-1-neg_binary64 (neg.f64 (*.f64 y z)))) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1 (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 y a) (*.f64 y z))) t)) x): 0 points increase in error, 0 points decrease in error
      (Rewrite=> +-commutative_binary64 (+.f64 x (*.f64 -1 (/.f64 (-.f64 (*.f64 y a) (*.f64 y z)) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> mul-1-neg_binary64 (neg.f64 (/.f64 (-.f64 (*.f64 y a) (*.f64 y z)) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 y a) (*.f64 y z)) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (*.f64 -1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 y a) t) (/.f64 (*.f64 y z) t))))): 0 points increase in error, 2 points decrease in error
      (+.f64 x (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) (*.f64 -1 (/.f64 (*.f64 y z) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite=> cancel-sign-sub-inv_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) (*.f64 (neg.f64 -1) (/.f64 (*.f64 y z) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) (*.f64 (Rewrite=> metadata-eval 1) (/.f64 (*.f64 y z) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) (Rewrite=> *-lft-identity_binary64 (/.f64 (*.f64 y z) t)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x (*.f64 -1 (/.f64 (*.f64 y a) t))) (/.f64 (*.f64 y z) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) x)) (/.f64 (*.f64 y z) t)): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) x) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (/.f64 (*.f64 y z) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) x) (neg.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 y z) t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= sub-neg_binary64 (-.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y a) t)) x) (*.f64 -1 (/.f64 (*.f64 y z) t)))): 0 points increase in error, 0 points decrease in error

    if 5.0000000000000002e-28 < a

    1. Initial program 13.9

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

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(y, \frac{z - t}{t - a}, y\right)} \]
      Proof
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (-.f64 t a)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 t a)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (-.f64 t a))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= associate-/r/_binary64 (/.f64 -1 (/.f64 -1 (-.f64 t a))))) y)): 11 points increase in error, 6 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 -1 (-.f64 t a)) -1))) y)): 6 points increase in error, 11 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 t a))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 t a))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 t) a)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 t)) a) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 a (neg.f64 t))) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (/.f64 (-.f64 z t) (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 a t)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite=> associate-/r/_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 a t)) -1)) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite<= *-commutative_binary64 (*.f64 -1 (/.f64 (-.f64 z t) (-.f64 a t)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (fma.f64 y (Rewrite<= neg-mul-1_binary64 (neg.f64 (/.f64 (-.f64 z t) (-.f64 a t)))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= fma-def_binary64 (+.f64 (*.f64 y (neg.f64 (/.f64 (-.f64 z t) (-.f64 a t)))) y))): 3 points increase in error, 4 points decrease in error
      (+.f64 x (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (-.f64 z t) (-.f64 a t)) y))) y)): 0 points increase in error, 0 points decrease in error
      (+.f64 x (+.f64 (neg.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))) y)): 59 points increase in error, 9 points decrease in error
      (+.f64 x (Rewrite<= +-commutative_binary64 (+.f64 y (neg.f64 (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= sub-neg_binary64 (-.f64 y (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))): 17 points increase in error, 5 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification8.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 10^{-279}:\\ \;\;\;\;x + \left(y + \frac{y}{\frac{t - a}{z - t}}\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(y, \frac{z - t}{t - a}, y\right)\\ \end{array} \]

Alternatives

Alternative 1
Error14.8
Cost1108
\[\begin{array}{l} t_1 := x - y \cdot \frac{z}{a}\\ \mathbf{if}\;a \leq -1.9857350767445347 \cdot 10^{+118}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq -5.1851378507809204 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-46}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 2
Error12.1
Cost1104
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{t - a}{z}}\\ \mathbf{if}\;a \leq -2.852517746680927 \cdot 10^{+198}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 10^{-279}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 10^{-40}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 3
Error10.8
Cost1104
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{t - a}{z}}\\ \mathbf{if}\;a \leq -1.9857350767445347 \cdot 10^{+118}:\\ \;\;\;\;\left(x + y\right) - z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 10^{-279}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 10^{-40}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 4
Error8.0
Cost1096
\[\begin{array}{l} t_1 := x + \left(y + \frac{y}{\frac{t - a}{z - t}}\right)\\ \mathbf{if}\;a \leq 10^{-279}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error21.2
Cost844
\[\begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-101}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-302}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-254}:\\ \;\;\;\;\frac{y \cdot z}{t - a}\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error11.3
Cost840
\[\begin{array}{l} \mathbf{if}\;a \leq -2.852517746680927 \cdot 10^{+198}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;x + \frac{y}{\frac{t - a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error14.2
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -1.1 \cdot 10^{-46}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 145400523.33049726:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error20.8
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-101}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 2.00903904207438 \cdot 10^{+95}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 9
Error29.3
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022291 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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