Average Error: 16.2 → 5.5
Time: 10.8s
Precision: binary64
Cost: 9804
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
\[\begin{array}{l} t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{y}{\frac{t}{z - a}} \cdot \frac{a}{t} + \left(x - \frac{y}{\frac{t}{a - z}}\right)\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \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
 (let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
   (if (<= t_1 (- INFINITY))
     (+ (* (/ y (/ t (- z a))) (/ a t)) (- x (/ y (/ t (- a z)))))
     (if (<= t_1 -2e-148)
       t_1
       (if (<= t_1 0.0)
         (+ x (* y (/ (- z a) t)))
         (+ 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 t_1 = (x + y) + ((y * (t - z)) / (a - t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = ((y / (t / (z - a))) * (a / t)) + (x - (y / (t / (a - z))));
	} else if (t_1 <= -2e-148) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = x + (y * ((z - a) / t));
	} 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)
	t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(Float64(y / Float64(t / Float64(z - a))) * Float64(a / t)) + Float64(x - Float64(y / Float64(t / Float64(a - z)))));
	elseif (t_1 <= -2e-148)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t)));
	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_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a / t), $MachinePrecision]), $MachinePrecision] + N[(x - N[(y / N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-148], t$95$1, If[LessEqual[t$95$1, 0.0], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $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}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t}{z - a}} \cdot \frac{a}{t} + \left(x - \frac{y}{\frac{t}{a - z}}\right)\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-148}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\

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


\end{array}

Error

Target

Original16.2
Target8.6
Herbie5.5
\[\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 4 regimes
  2. if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0

    1. Initial program 64.0

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

      \[\leadsto \color{blue}{\left(x + y\right) - \frac{z - t}{a - t} \cdot y} \]
      Proof
      (-.f64 (+.f64 x y) (*.f64 (/.f64 (-.f64 z t) (-.f64 a t)) y)): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 x y) (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t)))): 49 points increase in error, 10 points decrease in error
    3. Taylor expanded in t around -inf 43.6

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z - a}} \cdot \frac{a}{t} + \left(x - \frac{y}{\frac{t}{a - z}}\right)} \]
      Proof
      (+.f64 (*.f64 (/.f64 y (/.f64 t (-.f64 z a))) (/.f64 a t)) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z a)) t)) (/.f64 a t)) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 29 points increase in error, 4 points decrease in error
      (+.f64 (*.f64 (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y z) (*.f64 y a))) t) (/.f64 a t)) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (-.f64 (*.f64 y z) (*.f64 y a)) a) (*.f64 t t))) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 26 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 y z) (Rewrite<= *-commutative_binary64 (*.f64 a y))) a) (*.f64 t t)) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y)))) (*.f64 t t)) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (Rewrite<= unpow2_binary64 (pow.f64 t 2))) (-.f64 x (/.f64 y (/.f64 t (-.f64 a z))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (pow.f64 t 2)) (-.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 a z)) t)))): 9 points increase in error, 3 points decrease in error
      (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (pow.f64 t 2)) (-.f64 x (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y a) (*.f64 y z))) t))): 0 points increase in error, 1 points decrease in error
      (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (pow.f64 t 2)) (Rewrite<= unsub-neg_binary64 (+.f64 x (neg.f64 (/.f64 (-.f64 (*.f64 y a) (*.f64 y z)) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (pow.f64 t 2)) (+.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 (/.f64 (*.f64 a (-.f64 (*.f64 y z) (*.f64 a y))) (pow.f64 t 2)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 (*.f64 y a) (*.f64 y z)) t)) x))): 0 points increase in error, 0 points decrease in error

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

    1. Initial program 1.4

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

    if -1.99999999999999987e-148 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0

    1. Initial program 47.2

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

      \[\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)): 7 points increase in error, 0 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)): 0 points increase in error, 7 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))): 2 points increase in error, 2 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)): 49 points increase in error, 10 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)))): 9 points increase in error, 6 points decrease in error
    3. Taylor expanded in t around inf 55.8

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

      \[\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): 38 points increase in error, 20 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z a)) t)) x): 35 points increase in error, 28 points decrease in error
      (+.f64 (Rewrite<= +-lft-identity_binary64 (+.f64 0 (/.f64 (*.f64 y (-.f64 z a)) t))) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (Rewrite<= mul0-lft_binary64 (*.f64 0 y)) (/.f64 (*.f64 y (-.f64 z a)) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 (Rewrite<= metadata-eval (+.f64 -1 1)) y) (/.f64 (*.f64 y (-.f64 z a)) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (Rewrite<= distribute-rgt1-in_binary64 (+.f64 y (*.f64 -1 y))) (/.f64 (*.f64 y (-.f64 z a)) t)) x): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-+r+_binary64 (+.f64 y (+.f64 (*.f64 -1 y) (/.f64 (*.f64 y (-.f64 z a)) t)))) x): 19 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y (-.f64 z a)) t) (*.f64 -1 y)))) x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+r+_binary64 (+.f64 y (+.f64 (+.f64 (/.f64 (*.f64 y (-.f64 z a)) t) (*.f64 -1 y)) x))): 20 points increase in error, 9 points decrease in error
      (+.f64 y (Rewrite<= associate-+r+_binary64 (+.f64 (/.f64 (*.f64 y (-.f64 z a)) t) (+.f64 (*.f64 -1 y) x)))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in y around 0 9.2

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

      \[\leadsto \color{blue}{y \cdot \frac{z - a}{t}} + x \]
      Proof
      (*.f64 y (/.f64 (-.f64 z a) t)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y (-.f64 z a)) t)): 49 points increase in error, 49 points decrease in error

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

    1. Initial program 12.2

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
    2. Simplified5.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)): 7 points increase in error, 0 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)): 0 points increase in error, 7 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))): 2 points increase in error, 2 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)): 49 points increase in error, 10 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)))): 9 points increase in error, 6 points decrease in error
  3. Recombined 4 regimes into one program.
  4. Final simplification5.5

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

Alternatives

Alternative 1
Error8.8
Cost4432
\[\begin{array}{l} t_1 := x + \left(z - a\right) \cdot \frac{y}{t}\\ t_2 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-148}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error8.8
Cost4432
\[\begin{array}{l} t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{y}{\frac{t}{z - a}} \cdot \frac{a}{t} + \left(x - \frac{y}{\frac{t}{a - z}}\right)\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\ \end{array} \]
Alternative 3
Error7.3
Cost1096
\[\begin{array}{l} t_1 := x + \left(z - a\right) \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -7.5 \cdot 10^{+111}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{+169}:\\ \;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error22.8
Cost844
\[\begin{array}{l} t_1 := y \cdot \frac{z}{t - a}\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{+218}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error13.1
Cost840
\[\begin{array}{l} \mathbf{if}\;a \leq -0.0004:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{-26}:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error10.4
Cost840
\[\begin{array}{l} t_1 := \left(x + y\right) - \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;a \leq -2.6 \cdot 10^{-7}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-56}:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error14.0
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{-47}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-27}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error21.5
Cost588
\[\begin{array}{l} \mathbf{if}\;t \leq 2 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+170}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error21.5
Cost588
\[\begin{array}{l} \mathbf{if}\;t \leq 2 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+83}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+170}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error19.8
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -2.15 \cdot 10^{-119}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-174}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 11
Error28.7
Cost64
\[x \]

Error

Reproduce

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