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

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

\mathbf{else}:\\
\;\;\;\;y + x \cdot \frac{z - a}{t}\\


\end{array}

Error

Target

Original24.5
Target9.1
Herbie8.6
\[\begin{array}{l} \mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if t < -6.2269606400986425e70

    1. Initial program 43.3

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

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

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

      \[\leadsto \color{blue}{y - \left(\frac{a}{t} + 1\right) \cdot \frac{y - x}{\frac{t}{z - a}}} \]
      Proof
      (-.f64 y (*.f64 (+.f64 (/.f64 a t) 1) (/.f64 (-.f64 y x) (/.f64 t (-.f64 z a))))): 0 points increase in error, 0 points decrease in error
      (-.f64 y (*.f64 (+.f64 (/.f64 a t) 1) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 y x) (-.f64 z a)) t)))): 35 points increase in error, 10 points decrease in error
      (-.f64 y (*.f64 (+.f64 (/.f64 a t) 1) (/.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) t))): 0 points increase in error, 0 points decrease in error
      (-.f64 y (*.f64 (+.f64 (/.f64 a t) 1) (/.f64 (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 y x) z)) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (-.f64 y (Rewrite<= distribute-lft1-in_binary64 (+.f64 (*.f64 (/.f64 a t) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)))): 1 points increase in error, 2 points decrease in error
      (-.f64 y (+.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 a (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x)))) (*.f64 t t))) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 23 points increase in error, 6 points decrease in error
      (-.f64 y (+.f64 (/.f64 (*.f64 a (-.f64 (Rewrite=> *-commutative_binary64 (*.f64 z (-.f64 y x))) (*.f64 a (-.f64 y x)))) (*.f64 t t)) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (-.f64 y (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (Rewrite<= unpow2_binary64 (pow.f64 t 2))) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 y (neg.f64 (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2)) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (+.f64 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2)) (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (Rewrite<= distribute-lft-out_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+r+_binary64 (+.f64 (+.f64 y (*.f64 -1 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (Rewrite=> mul-1-neg_binary64 (neg.f64 (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2))))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> unsub-neg_binary64 (-.f64 y (/.f64 (*.f64 a (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) (pow.f64 t 2)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 y (/.f64 (Rewrite=> *-commutative_binary64 (*.f64 (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x))) a)) (pow.f64 t 2))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 y (/.f64 (*.f64 (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 y x) z)) (*.f64 a (-.f64 y x))) a) (pow.f64 t 2))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 y (/.f64 (*.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) a) (Rewrite=> unpow2_binary64 (*.f64 t t)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 y (Rewrite=> times-frac_binary64 (*.f64 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t) (/.f64 a t)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 6 points increase in error, 23 points decrease in error
      (+.f64 (Rewrite=> cancel-sign-sub-inv_binary64 (+.f64 y (*.f64 (neg.f64 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)) (/.f64 a t)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (*.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))) (/.f64 a t))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (*.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x)))) t)) (/.f64 a t))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (*.f64 (/.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x))))) t) (/.f64 a t))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 y (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (*.f64 t t)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 23 points increase in error, 6 points decrease in error
      (+.f64 (+.f64 y (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (Rewrite<= unpow2_binary64 (pow.f64 t 2)))) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y)) (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y) (*.f64 -1 (/.f64 (-.f64 (Rewrite=> *-commutative_binary64 (*.f64 z (-.f64 y x))) (*.f64 a (-.f64 y x))) t))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y) (*.f64 -1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 z (-.f64 y x)) t) (/.f64 (*.f64 a (-.f64 y x)) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y) (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t)) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y) (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t))) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t)) (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 (*.f64 (-.f64 y x) z)) (*.f64 -1 (*.f64 a (-.f64 y x)))) a) (pow.f64 t 2)) y))) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t))): 0 points increase in error, 0 points decrease in error

    if -6.2269606400986425e70 < t < 9.60042790147939708e162

    1. Initial program 13.6

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

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

    if 9.60042790147939708e162 < t

    1. Initial program 47.9

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

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

      \[\leadsto \color{blue}{y - \frac{y - x}{t} \cdot \left(z - a\right)} \]
      Proof
      (-.f64 y (*.f64 (/.f64 (-.f64 y x) t) (-.f64 z a))): 0 points increase in error, 0 points decrease in error
      (-.f64 y (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 y x) (/.f64 t (-.f64 z a))))): 23 points increase in error, 34 points decrease in error
      (-.f64 y (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 y x) (-.f64 z a)) t))): 41 points increase in error, 21 points decrease in error
      (-.f64 y (/.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 z (-.f64 y x)) (*.f64 a (-.f64 y x)))) t)): 0 points increase in error, 0 points decrease in error
      (-.f64 y (/.f64 (-.f64 (Rewrite=> *-commutative_binary64 (*.f64 (-.f64 y x) z)) (*.f64 a (-.f64 y x))) t)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 y (neg.f64 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 (-.f64 y x) z) (*.f64 a (-.f64 y x))) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (*.f64 -1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 (-.f64 y x) z) t) (/.f64 (*.f64 a (-.f64 y x)) t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (*.f64 -1 (-.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 z (-.f64 y x))) t) (/.f64 (*.f64 a (-.f64 y x)) t)))): 0 points increase in error, 0 points decrease in error
      (+.f64 y (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t)) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 y (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t))) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t)))): 1 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 z (-.f64 y x)) t)) y)) (*.f64 -1 (/.f64 (*.f64 a (-.f64 y x)) t))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in y around 0 20.0

      \[\leadsto y - \color{blue}{-1 \cdot \frac{\left(z - a\right) \cdot x}{t}} \]
    5. Simplified11.8

      \[\leadsto y - \color{blue}{x \cdot \frac{a - z}{t}} \]
      Proof
      (*.f64 x (/.f64 (-.f64 a z) t)): 0 points increase in error, 0 points decrease in error
      (*.f64 x (Rewrite=> div-sub_binary64 (-.f64 (/.f64 a t) (/.f64 z t)))): 3 points increase in error, 0 points decrease in error
      (*.f64 x (Rewrite=> sub-neg_binary64 (+.f64 (/.f64 a t) (neg.f64 (/.f64 z t))))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (/.f64 a t)))) (neg.f64 (/.f64 z t)))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (neg.f64 (/.f64 a t)) (/.f64 z t))))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 z t) (neg.f64 (/.f64 a t)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (/.f64 z t) (/.f64 a t))))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (neg.f64 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 z a) t)))): 0 points increase in error, 3 points decrease in error
      (*.f64 x (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 z a) t)))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 (-.f64 z a) t) -1))): 0 points increase in error, 0 points decrease in error
      (*.f64 x (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 z a) (/.f64 t -1)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 x (-.f64 z a)) (/.f64 t -1))): 47 points increase in error, 41 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 z a) x)) (/.f64 t -1)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-/r/_binary64 (*.f64 (/.f64 (*.f64 (-.f64 z a) x) t) -1)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -1 (/.f64 (*.f64 (-.f64 z a) x) t))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification8.6

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

Alternatives

Alternative 1
Error7.6
Cost4432
\[\begin{array}{l} t_1 := x - \frac{\left(z - t\right) \cdot \left(x - y\right)}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;y + \left(y - x\right) \cdot \frac{a - z}{t}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-290}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y - \left(z - a\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{t}\right)\\ \end{array} \]
Alternative 2
Error7.6
Cost4432
\[\begin{array}{l} t_1 := y + \frac{y - x}{\frac{t}{z - a}} \cdot \left(-1 - \frac{a}{t}\right)\\ t_2 := x - \frac{\left(z - t\right) \cdot \left(x - y\right)}{a - t}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{-290}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y - \left(z - a\right) \cdot \left(\left(y - x\right) \cdot \frac{1}{t}\right)\\ \end{array} \]
Alternative 3
Error8.6
Cost1608
\[\begin{array}{l} t_1 := \frac{a - t}{z - t}\\ \mathbf{if}\;t \leq -6.226960640098642 \cdot 10^{+70}:\\ \;\;\;\;y + \frac{y - x}{\frac{t}{z - a}} \cdot \left(-1 - \frac{a}{t}\right)\\ \mathbf{elif}\;t \leq 9.600427901479397 \cdot 10^{+162}:\\ \;\;\;\;x + \left(\frac{y}{t_1} - \frac{x}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;y + x \cdot \frac{z - a}{t}\\ \end{array} \]
Alternative 4
Error21.2
Cost1368
\[\begin{array}{l} t_1 := y + \frac{z}{t} \cdot \left(x - y\right)\\ t_2 := x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -4.4349267032760444 \cdot 10^{+82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -3.5712103661105745 \cdot 10^{-19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.95 \cdot 10^{-81}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{elif}\;a \leq 1.766499308596977 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.163177130231748 \cdot 10^{+97}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 9.769076083526911 \cdot 10^{+110}:\\ \;\;\;\;y - a \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error21.3
Cost1368
\[\begin{array}{l} t_1 := y + \frac{z}{t} \cdot \left(x - y\right)\\ t_2 := x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -4.4349267032760444 \cdot 10^{+82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2.9245600818593703 \cdot 10^{-10}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.28 \cdot 10^{-95}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{elif}\;a \leq 1.766499308596977 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.163177130231748 \cdot 10^{+97}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.9134071202135543 \cdot 10^{+134}:\\ \;\;\;\;y - a \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error17.1
Cost1232
\[\begin{array}{l} t_1 := y + \left(y - x\right) \cdot \frac{a - z}{t}\\ \mathbf{if}\;t \leq -4.307823088579786 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y - x}{\frac{a - t}{t}}\\ \mathbf{elif}\;t \leq 10^{-303}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 7.980373226374058 \cdot 10^{-44}:\\ \;\;\;\;x + \frac{z - t}{\frac{a}{y - x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error19.8
Cost1104
\[\begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\ t_2 := y + x \cdot \frac{z - a}{t}\\ \mathbf{if}\;t \leq -6.226960640098642 \cdot 10^{+70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -3.559178090940448 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.980373226374058 \cdot 10^{-44}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 6.278112954080546 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error19.5
Cost1104
\[\begin{array}{l} t_1 := y + x \cdot \frac{z - a}{t}\\ \mathbf{if}\;t \leq -6.226960640098642 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.559178090940448 \cdot 10^{-44}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{elif}\;t \leq 7.980373226374058 \cdot 10^{-44}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 6.278112954080546 \cdot 10^{+56}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error19.4
Cost1104
\[\begin{array}{l} t_1 := y + x \cdot \frac{z - a}{t}\\ \mathbf{if}\;t \leq -2.456382514512261 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y - x}{\frac{a - t}{t}}\\ \mathbf{elif}\;t \leq 7.980373226374058 \cdot 10^{-44}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 6.278112954080546 \cdot 10^{+56}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error17.1
Cost1100
\[\begin{array}{l} t_1 := y + \left(y - x\right) \cdot \frac{a - z}{t}\\ \mathbf{if}\;t \leq -4.307823088579786 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.4 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y - x}{\frac{a - t}{t}}\\ \mathbf{elif}\;t \leq 7.057841344089583 \cdot 10^{-41}:\\ \;\;\;\;x + \frac{y - x}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error27.7
Cost844
\[\begin{array}{l} t_1 := y - a \cdot \frac{x}{t}\\ \mathbf{if}\;t \leq -8.962593948563744 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.2 \cdot 10^{-83}:\\ \;\;\;\;x - y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq 5.311739848388444 \cdot 10^{-35}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error26.2
Cost840
\[\begin{array}{l} t_1 := y - a \cdot \frac{x}{t}\\ \mathbf{if}\;t \leq -5.992745931684429 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.311739848388444 \cdot 10^{-35}:\\ \;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error30.0
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -5.992745931684429 \cdot 10^{+43}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq 5.311739848388444 \cdot 10^{-35}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 14
Error28.4
Cost712
\[\begin{array}{l} t_1 := y - \frac{a \cdot x}{t}\\ \mathbf{if}\;t \leq -5.992745931684429 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.311739848388444 \cdot 10^{-35}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error27.3
Cost712
\[\begin{array}{l} t_1 := y - a \cdot \frac{x}{t}\\ \mathbf{if}\;t \leq -5.992745931684429 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.311739848388444 \cdot 10^{-35}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error36.1
Cost328
\[\begin{array}{l} \mathbf{if}\;a \leq -4.47160237111879 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 9.769076083526911 \cdot 10^{+110}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 17
Error45.6
Cost64
\[y \]

Error

Reproduce

herbie shell --seed 2022318 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))

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