Average Error: 24.8 → 6.7
Time: 23.7s
Precision: binary64
Cost: 7620
\[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
\[\begin{array}{l} t_1 := \frac{y - z}{z - a}\\ t_2 := \frac{z}{t - x}\\ \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{y}{t_2}, t\right) + \frac{a}{t_2}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+192}:\\ \;\;\;\;x \cdot \left(1 + t_1\right) - t \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\ \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- y z) (- z a))) (t_2 (/ z (- t x))))
   (if (<= z -1e+154)
     (+ (fma -1.0 (/ y t_2) t) (/ a t_2))
     (if (<= z 3e+192)
       (- (* x (+ 1.0 t_1)) (* t t_1))
       (- t (* (- t x) (/ (- y a) z)))))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - z) * (t - x)) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y - z) / (z - a);
	double t_2 = z / (t - x);
	double tmp;
	if (z <= -1e+154) {
		tmp = fma(-1.0, (y / t_2), t) + (a / t_2);
	} else if (z <= 3e+192) {
		tmp = (x * (1.0 + t_1)) - (t * t_1);
	} else {
		tmp = t - ((t - x) * ((y - a) / z));
	}
	return tmp;
}
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)))
end
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y - z) / Float64(z - a))
	t_2 = Float64(z / Float64(t - x))
	tmp = 0.0
	if (z <= -1e+154)
		tmp = Float64(fma(-1.0, Float64(y / t_2), t) + Float64(a / t_2));
	elseif (z <= 3e+192)
		tmp = Float64(Float64(x * Float64(1.0 + t_1)) - Float64(t * t_1));
	else
		tmp = Float64(t - Float64(Float64(t - x) * Float64(Float64(y - a) / z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+154], N[(N[(-1.0 * N[(y / t$95$2), $MachinePrecision] + t), $MachinePrecision] + N[(a / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+192], N[(N[(x * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(t - x), $MachinePrecision] * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\begin{array}{l}
t_1 := \frac{y - z}{z - a}\\
t_2 := \frac{z}{t - x}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{t_2}, t\right) + \frac{a}{t_2}\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+192}:\\
\;\;\;\;x \cdot \left(1 + t_1\right) - t \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\


\end{array}

Error

Target

Original24.8
Target12.1
Herbie6.7
\[\begin{array}{l} \mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{y}{z} \cdot \left(t - x\right)\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.00000000000000004e154

    1. Initial program 47.6

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

      \[\leadsto \color{blue}{x + \frac{y - z}{\frac{a - z}{t - x}}} \]
      Proof
      (+.f64 x (/.f64 (-.f64 y z) (/.f64 (-.f64 a z) (-.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 97 points increase in error, 32 points decrease in error
    3. Taylor expanded in z around inf 25.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{y}{\frac{z}{t - x}}, t\right) - \left(-\frac{a}{\frac{z}{t - x}}\right)} \]
      Proof
      (-.f64 (fma.f64 -1 (/.f64 y (/.f64 z (-.f64 t x))) t) (neg.f64 (/.f64 a (/.f64 z (-.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (fma.f64 -1 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 t x)) z)) t) (neg.f64 (/.f64 a (/.f64 z (-.f64 t x))))): 26 points increase in error, 11 points decrease in error
      (-.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y (-.f64 t x)) z)) t)) (neg.f64 (/.f64 a (/.f64 z (-.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y (-.f64 t x)) z)) t) (neg.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a (-.f64 t x)) z)))): 19 points increase in error, 6 points decrease in error
      (-.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y (-.f64 t x)) z)) t) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 a (-.f64 t x)) z)))): 0 points increase in error, 0 points decrease in error

    if -1.00000000000000004e154 < z < 3e192

    1. Initial program 16.7

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{x - t}{z - a}, x\right)} \]
      Proof
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 x t) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (-.f64 x t)))) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (neg.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 x t)))) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (neg.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 x) t))) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (neg.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 x)) t)) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 t (neg.f64 x)))) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 t x))) (-.f64 z a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (neg.f64 (-.f64 t x)) (-.f64 z a)))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (*.f64 (Rewrite<= metadata-eval (/.f64 -1 -1)) (/.f64 (neg.f64 (-.f64 t x)) (-.f64 z a))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 -1 (neg.f64 (-.f64 t x))) (*.f64 -1 (-.f64 z a)))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (neg.f64 (-.f64 t x)))) (*.f64 -1 (-.f64 z a))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (Rewrite=> remove-double-neg_binary64 (-.f64 t x)) (*.f64 -1 (-.f64 z a))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 z a)))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 z a)))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 z) a))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 z)) a)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (Rewrite<= +-commutative_binary64 (+.f64 a (neg.f64 z)))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 (-.f64 y z) (/.f64 (-.f64 t x) (Rewrite<= sub-neg_binary64 (-.f64 a z))) x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))) x)): 25 points increase in error, 25 points decrease in error
      (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) x): 95 points increase in error, 38 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in x around 0 11.8

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

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{y - z}{z - a}\right) - t \cdot \frac{y - z}{z - a}} \]
      Proof
      (-.f64 (*.f64 x (+.f64 1 (/.f64 (-.f64 y z) (-.f64 z a)))) (*.f64 t (/.f64 (-.f64 y z) (-.f64 z a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x (+.f64 1 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 y (-.f64 z a)) (/.f64 z (-.f64 z a)))))) (*.f64 t (/.f64 (-.f64 y z) (-.f64 z a)))): 0 points increase in error, 1 points decrease in error
      (-.f64 (*.f64 x (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 1 (/.f64 y (-.f64 z a))) (/.f64 z (-.f64 z a))))) (*.f64 t (/.f64 (-.f64 y z) (-.f64 z a)))): 0 points increase in error, 1 points decrease in error
      (-.f64 (*.f64 x (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 y (-.f64 z a)) 1)) (/.f64 z (-.f64 z a)))) (*.f64 t (/.f64 (-.f64 y z) (-.f64 z a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (+.f64 (/.f64 y (-.f64 z a)) 1) (/.f64 z (-.f64 z a))) x)) (*.f64 t (/.f64 (-.f64 y z) (-.f64 z a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (-.f64 (+.f64 (/.f64 y (-.f64 z a)) 1) (/.f64 z (-.f64 z a))) x) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 t (-.f64 y z)) (-.f64 z a)))): 60 points increase in error, 13 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 (-.f64 (+.f64 (/.f64 y (-.f64 z a)) 1) (/.f64 z (-.f64 z a))) x) (neg.f64 (/.f64 (*.f64 t (-.f64 y z)) (-.f64 z a))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (-.f64 (+.f64 (/.f64 y (-.f64 z a)) 1) (/.f64 z (-.f64 z a))) x) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 t (-.f64 y z)) (-.f64 z a))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 t (-.f64 y z)) (-.f64 z a))) (*.f64 (-.f64 (+.f64 (/.f64 y (-.f64 z a)) 1) (/.f64 z (-.f64 z a))) x))): 0 points increase in error, 0 points decrease in error

    if 3e192 < z

    1. Initial program 49.6

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)} \]
      Proof
      (fma.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x) x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (-.f64 y z) (-.f64 a z)) (-.f64 t x)) x)): 5 points increase in error, 4 points decrease in error
      (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) x): 94 points increase in error, 23 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in z around inf 24.2

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

      \[\leadsto \color{blue}{t - \frac{y - a}{z} \cdot \left(t - x\right)} \]
      Proof
      (-.f64 t (*.f64 (/.f64 (-.f64 y a) z) (-.f64 t x))): 0 points increase in error, 0 points decrease in error
      (-.f64 t (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (-.f64 y a) (-.f64 t x)) z))): 39 points increase in error, 26 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 t (neg.f64 (/.f64 (*.f64 (-.f64 y a) (-.f64 t x)) z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 t (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 (-.f64 y a) (-.f64 t x)) z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 t (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1 (*.f64 (-.f64 y a) (-.f64 t x))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 t (/.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 -1 (-.f64 y a)) (-.f64 t x))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 t (/.f64 (*.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 y) (*.f64 -1 a))) (-.f64 t x)) z)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (-.f64 (*.f64 -1 y) (*.f64 -1 a)) (-.f64 t x)) z) t)): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification6.7

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

Alternatives

Alternative 1
Error7.0
Cost1608
\[\begin{array}{l} t_1 := \frac{y - z}{z - a}\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{+154}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+191}:\\ \;\;\;\;x \cdot \left(1 + t_1\right) - t \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\ \end{array} \]
Alternative 2
Error24.2
Cost1368
\[\begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -2.4 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq -15000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -7.4 \cdot 10^{-123}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{-156}:\\ \;\;\;\;t + y \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 4.6 \cdot 10^{+144}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error19.8
Cost1364
\[\begin{array}{l} t_1 := x - \frac{x - t}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+148}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-44}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3000:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\ \end{array} \]
Alternative 4
Error22.2
Cost1236
\[\begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;a \leq -6.2 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq -6.4 \cdot 10^{-82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-139}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+144}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error21.2
Cost1236
\[\begin{array}{l} t_1 := x - \frac{x - t}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -1.95 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-96}:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;a \leq 2 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-20}:\\ \;\;\;\;t + \frac{y \cdot x}{z}\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+60}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error20.9
Cost1236
\[\begin{array}{l} t_1 := t + \left(y - a\right) \cdot \frac{x}{z}\\ t_2 := x - \frac{x - t}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-46}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{-99}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 0.3:\\ \;\;\;\;t - y \cdot \frac{t - x}{z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error24.7
Cost1104
\[\begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -1 \cdot 10^{+149}:\\ \;\;\;\;t + \frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{-100}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{+189}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - \frac{a}{\frac{z}{x}}\\ \end{array} \]
Alternative 8
Error9.0
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+145}:\\ \;\;\;\;t + \left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+74}:\\ \;\;\;\;x + \left(t - x\right) \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - \left(t - x\right) \cdot \frac{y - a}{z}\\ \end{array} \]
Alternative 9
Error32.9
Cost976
\[\begin{array}{l} t_1 := t + y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -6 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-165}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-256}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-102}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error29.4
Cost976
\[\begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t + y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-99}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error29.5
Cost976
\[\begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t + y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -2.3 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-288}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y}}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-105}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error30.7
Cost976
\[\begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t + y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{-257}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-99}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error30.4
Cost976
\[\begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t + y \cdot \frac{x}{z}\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-162}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{-258}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-99}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error30.5
Cost976
\[\begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -3.7 \cdot 10^{+39}:\\ \;\;\;\;t + \frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -3.65 \cdot 10^{-162}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-254}:\\ \;\;\;\;\left(t - x\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{-99}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \frac{x}{z}\\ \end{array} \]
Alternative 15
Error26.2
Cost976
\[\begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -9.5 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-96}:\\ \;\;\;\;t + y \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 1.92 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.15 \cdot 10^{-20}:\\ \;\;\;\;t + \frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error37.4
Cost716
\[\begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+91}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-164}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-258}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-9}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 17
Error36.1
Cost328
\[\begin{array}{l} \mathbf{if}\;a \leq -15500000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+116}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 18
Error45.4
Cost64
\[t \]

Error

Reproduce

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

  :herbie-target
  (if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))

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