Average Error: 20.6 → 5.8
Time: 55.3s
Precision: binary64
Cost: 17484
\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ t_2 := \frac{\mathsf{fma}\left(9, \frac{y}{\frac{z}{x}}, a \cdot \left(t \cdot -4\right)\right)}{c}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-200}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0.5:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
        (t_2 (/ (fma 9.0 (/ y (/ z x)) (* a (* t -4.0))) c)))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -2e-200)
       t_1
       (if (<= t_1 0.5)
         (/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c)
         (if (<= t_1 2e+305) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
	double t_2 = fma(9.0, (y / (z / x)), (a * (t * -4.0))) / c;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -2e-200) {
		tmp = t_1;
	} else if (t_1 <= 0.5) {
		tmp = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
	} else if (t_1 <= 2e+305) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
end
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
	t_2 = Float64(fma(9.0, Float64(y / Float64(z / x)), Float64(a * Float64(t * -4.0))) / c)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -2e-200)
		tmp = t_1;
	elseif (t_1 <= 0.5)
		tmp = Float64(fma(t, Float64(a * -4.0), Float64(fma(x, Float64(9.0 * y), b) / z)) / c);
	elseif (t_1 <= 2e+305)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-200], t$95$1, If[LessEqual[t$95$1, 0.5], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], t$95$1, t$95$2]]]]]]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\begin{array}{l}
t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
t_2 := \frac{\mathsf{fma}\left(9, \frac{y}{\frac{z}{x}}, a \cdot \left(t \cdot -4\right)\right)}{c}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t_1 \leq 0.5:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Error

Target

Original20.6
Target14.6
Herbie5.8
\[\begin{array}{l} \mathbf{if}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} < -1.100156740804105 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} < 0:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} < 1.1708877911747488 \cdot 10^{-53}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} < 2.876823679546137 \cdot 10^{+130}:\\ \;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} < 1.3838515042456319 \cdot 10^{+158}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \end{array} \]

Derivation

  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -inf.0 or 1.9999999999999999e305 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c))

    1. Initial program 63.7

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

      \[\leadsto \color{blue}{\frac{9 \cdot \left(y \cdot x\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c \cdot z}} \]
    3. Simplified20.9

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(9, \frac{y}{\frac{z}{x}}, a \cdot \left(t \cdot -4\right)\right)}{c}} \]
      Proof
      (/.f64 (fma.f64 9 (/.f64 y (/.f64 z x)) (*.f64 a (*.f64 t -4))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) z)) (*.f64 a (*.f64 t -4))) c): 31 points increase in error, 26 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a t) -4))) c): 0 points increase in error, 1 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (*.f64 (*.f64 a t) (Rewrite<= metadata-eval (neg.f64 4)))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (*.f64 a t) 4)))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 (*.f64 a t))))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 (*.f64 4 (*.f64 a t)) 1)))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (/.f64 (*.f64 4 (*.f64 a t)) (Rewrite<= *-inverses_binary64 (/.f64 z z))))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (*.f64 4 (*.f64 a t)) z) z)))) c): 27 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 4 (*.f64 (*.f64 a t) z))) z))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 9 (/.f64 (*.f64 y x) z) (neg.f64 (/.f64 (*.f64 4 (Rewrite<= associate-*r*_binary64 (*.f64 a (*.f64 t z)))) z))) c): 26 points increase in error, 5 points decrease in error
      (/.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 9 (/.f64 (*.f64 y x) z)) (/.f64 (*.f64 4 (*.f64 a (*.f64 t z))) z))) c): 2 points increase in error, 2 points decrease in error
      (/.f64 (-.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 9 (*.f64 y x)) z)) (/.f64 (*.f64 4 (*.f64 a (*.f64 t z))) z)) c): 14 points increase in error, 11 points decrease in error
      (/.f64 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 9 (*.f64 y x)) (*.f64 4 (*.f64 a (*.f64 t z)))) z)) c): 2 points increase in error, 2 points decrease in error
      (Rewrite=> associate-/l/_binary64 (/.f64 (-.f64 (*.f64 9 (*.f64 y x)) (*.f64 4 (*.f64 a (*.f64 t z)))) (*.f64 c z))): 44 points increase in error, 43 points decrease in error

    if -inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -2e-200 or 0.5 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 1.9999999999999999e305

    1. Initial program 0.6

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

    if -2e-200 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 0.5

    1. Initial program 19.3

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \]
    2. Simplified0.8

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}} \]
      Proof
      (/.f64 (fma.f64 t (*.f64 a -4) (/.f64 (fma.f64 x (*.f64 9 y) b) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (*.f64 a (Rewrite<= metadata-eval (neg.f64 4))) (/.f64 (fma.f64 x (*.f64 9 y) b) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a 4))) (/.f64 (fma.f64 x (*.f64 9 y) b) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (Rewrite<= distribute-lft-neg-out_binary64 (*.f64 (neg.f64 a) 4)) (/.f64 (fma.f64 x (*.f64 9 y) b) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (Rewrite=> *-commutative_binary64 (*.f64 4 (neg.f64 a))) (/.f64 (fma.f64 x (*.f64 9 y) b) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (*.f64 4 (neg.f64 a)) (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x (*.f64 9 y)) b)) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 t (*.f64 4 (neg.f64 a)) (/.f64 (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 x 9) y)) b) z)) c): 6 points increase in error, 7 points decrease in error
      (/.f64 (fma.f64 t (*.f64 4 (neg.f64 a)) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 b (*.f64 (*.f64 x 9) y))) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 t (*.f64 4 (neg.f64 a))) (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z))) c): 2 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 t 4) (neg.f64 a))) (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 t)) (neg.f64 a)) (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite=> distribute-rgt-neg-out_binary64 (neg.f64 (*.f64 (*.f64 4 t) a))) (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z)) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (neg.f64 (*.f64 (*.f64 4 t) a)))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> unsub-neg_binary64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (*.f64 (*.f64 4 t) a))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (Rewrite=> associate-*l*_binary64 (*.f64 4 (*.f64 t a)))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (*.f64 (Rewrite<= metadata-eval (/.f64 4 1)) (*.f64 t a))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (*.f64 (/.f64 4 (Rewrite<= *-inverses_binary64 (/.f64 z z))) (*.f64 t a))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 4 z) z)) (*.f64 t a))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (*.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 z 4)) z) (*.f64 t a))) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (Rewrite<= associate-/r/_binary64 (/.f64 (*.f64 z 4) (/.f64 z (*.f64 t a))))) c): 17 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (*.f64 z 4) (*.f64 t a)) z))) c): 23 points increase in error, 14 points decrease in error
      (/.f64 (-.f64 (/.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) z) (/.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 z 4) t) a)) z)) c): 22 points increase in error, 3 points decrease in error
      (/.f64 (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (+.f64 b (*.f64 (*.f64 x 9) y)) (*.f64 (*.f64 (*.f64 z 4) t) a)) z)) c): 1 points increase in error, 2 points decrease in error
      (/.f64 (/.f64 (Rewrite<= associate-+r-_binary64 (+.f64 b (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)))) z) c): 0 points increase in error, 0 points decrease in error
      (/.f64 (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b)) z) c): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r*_binary64 (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c))): 45 points increase in error, 57 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification5.8

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

Alternatives

Alternative 1
Error6.5
Cost12368
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ t_2 := x \cdot \left(9 \cdot y\right)\\ t_3 := \frac{\mathsf{fma}\left(9, \frac{y}{\frac{z}{x}}, a \cdot \left(t \cdot -4\right)\right)}{c}\\ t_4 := z \cdot \left(a \cdot \left(4 \cdot t\right)\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-221}:\\ \;\;\;\;\frac{t_2}{z \cdot c} - \frac{t_4 - b}{z \cdot c}\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b + \left(t_2 - t_4\right)}{c}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 2
Error8.3
Cost6352
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{\frac{b}{z} + t_1}{c}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-280}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \end{array} \]
Alternative 3
Error6.7
Cost6352
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-160}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - z \cdot \left(a \cdot \left(4 \cdot t\right)\right)\right)}{z} \cdot \frac{1}{c}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \end{array} \]
Alternative 4
Error7.0
Cost6352
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t_1 \leq -5 \cdot 10^{-160}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b + \left(x \cdot \left(9 \cdot y\right) - z \cdot \left(a \cdot \left(4 \cdot t\right)\right)\right)}{c}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \end{array} \]
Alternative 5
Error7.5
Cost6352
\[\begin{array}{l} t_1 := x \cdot \left(9 \cdot y\right)\\ t_2 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\ t_3 := z \cdot \left(a \cdot \left(4 \cdot t\right)\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-221}:\\ \;\;\;\;\frac{t_1}{z \cdot c} - \frac{t_3 - b}{z \cdot c}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b + \left(t_1 - t_3\right)}{c}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \end{array} \]
Alternative 6
Error37.0
Cost2916
\[\begin{array}{l} t_1 := 9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\ t_2 := \frac{t \cdot \left(a \cdot -4\right)}{c}\\ t_3 := \frac{b}{z \cdot c}\\ \mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot 9 \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot 9 \leq -3 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot 9 \leq -2000000000:\\ \;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\ \mathbf{elif}\;x \cdot 9 \leq -2 \cdot 10^{-45}:\\ \;\;\;\;\frac{1}{z \cdot \frac{c}{b}}\\ \mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{-189}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{elif}\;x \cdot 9 \leq 2 \cdot 10^{-246}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot 9 \leq 5 \cdot 10^{-210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot 9 \leq 4 \cdot 10^{-131}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error37.4
Cost2916
\[\begin{array}{l} t_1 := \left(x \cdot \frac{y}{z}\right) \cdot \frac{9}{c}\\ t_2 := \frac{t \cdot \left(a \cdot -4\right)}{c}\\ t_3 := \frac{b}{z \cdot c}\\ \mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+180}:\\ \;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\ \mathbf{elif}\;x \cdot 9 \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot 9 \leq -3 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot 9 \leq -2000000000:\\ \;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\ \mathbf{elif}\;x \cdot 9 \leq -2 \cdot 10^{-45}:\\ \;\;\;\;\frac{1}{z \cdot \frac{c}{b}}\\ \mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{-189}:\\ \;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{elif}\;x \cdot 9 \leq 2 \cdot 10^{-246}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot 9 \leq 5 \cdot 10^{-210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot 9 \leq 4 \cdot 10^{-131}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error29.8
Cost1760
\[\begin{array}{l} t_1 := \frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}\\ t_2 := \frac{t \cdot \left(a \cdot -4\right)}{c}\\ \mathbf{if}\;z \leq -9.14133491480423 \cdot 10^{+213}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.032775886172551 \cdot 10^{+195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.702119316431146 \cdot 10^{+137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 60000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.266788052493359 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.5181814626848326 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{a}{\frac{c}{-4}}\\ \mathbf{elif}\;z \leq 1.4171577864265051 \cdot 10^{+140}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error23.6
Cost1744
\[\begin{array}{l} t_1 := \frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+202}:\\ \;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\ \mathbf{elif}\;x \cdot 9 \leq -5 \cdot 10^{+165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot 9 \leq -3 \cdot 10^{+91}:\\ \;\;\;\;\frac{\frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}\\ \mathbf{elif}\;x \cdot 9 \leq 2 \cdot 10^{-101}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{y}{z}\right) \cdot \frac{9}{c}\\ \end{array} \]
Alternative 10
Error19.5
Cost1360
\[\begin{array}{l} t_1 := \frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{if}\;z \leq -6.514534304578125 \cdot 10^{+65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \mathbf{elif}\;z \leq 60000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.266788052493359 \cdot 10^{+68}:\\ \;\;\;\;\frac{\frac{b}{z} + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error19.5
Cost1360
\[\begin{array}{l} t_1 := \frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{if}\;z \leq -6.514534304578125 \cdot 10^{+65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-55}:\\ \;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c} + \frac{b}{z \cdot c}\\ \mathbf{elif}\;z \leq 60000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.266788052493359 \cdot 10^{+68}:\\ \;\;\;\;\frac{\frac{b}{z} + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error20.7
Cost1360
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := \frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 10^{-36}:\\ \;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c} + \frac{b}{z \cdot c}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{+50}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.266788052493359 \cdot 10^{+68}:\\ \;\;\;\;\frac{\frac{b}{z} + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z} + t_1}{c}\\ \end{array} \]
Alternative 13
Error19.6
Cost1232
\[\begin{array}{l} t_1 := b + 9 \cdot \left(x \cdot y\right)\\ t_2 := \frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{if}\;z \leq -6.514534304578125 \cdot 10^{+65}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-55}:\\ \;\;\;\;\frac{t_1}{z \cdot c}\\ \mathbf{elif}\;z \leq 60000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.266788052493359 \cdot 10^{+68}:\\ \;\;\;\;\frac{\frac{t_1}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error35.1
Cost976
\[\begin{array}{l} t_1 := \frac{t \cdot \left(a \cdot -4\right)}{c}\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 10^{-36}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \mathbf{elif}\;z \leq 3.5181814626848326 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.712737298051383 \cdot 10^{+102}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error43.4
Cost712
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+155}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;b \leq 10^{+156}:\\ \;\;\;\;\frac{\frac{1}{c}}{\frac{z}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \end{array} \]
Alternative 16
Error41.9
Cost584
\[\begin{array}{l} t_1 := \frac{\frac{b}{c}}{z}\\ \mathbf{if}\;c \leq -1.1716191590364377 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 82000:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error43.5
Cost584
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+165}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;b \leq 10^{+156}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \end{array} \]
Alternative 18
Error44.4
Cost320
\[\frac{\frac{b}{z}}{c} \]

Error

Reproduce

herbie shell --seed 2022318 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, J"
  :precision binary64

  :herbie-target
  (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))

  (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))