?

Average Error: 31.84% → 8.68%
Time: 29.4s
Precision: binary64
Cost: 10056

?

\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ [t, a] = \mathsf{sort}([t, a])\\ \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 + a \cdot \left(t \cdot \left(z \cdot -4\right)\right)\right) + b}{z \cdot c}\\ t_2 := \frac{\frac{b}{c}}{z} + \left(\frac{x}{\frac{z \cdot c}{9 \cdot y}} + \frac{a}{\frac{c}{t}} \cdot -4\right)\\ t_3 := x \cdot \left(9 \cdot y\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+298}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{+56}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right) + t_3}{z \cdot c}\\ \mathbf{elif}\;t_1 \leq 2000000000:\\ \;\;\;\;\frac{a \cdot \left(t \cdot -4\right) + \frac{b + t_3}{z}}{c}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;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) (* a (* t (* z -4.0)))) b) (* z c)))
        (t_2
         (+
          (/ (/ b c) z)
          (+ (/ x (/ (* z c) (* 9.0 y))) (* (/ a (/ c t)) -4.0))))
        (t_3 (* x (* 9.0 y))))
   (if (<= t_1 -5e+298)
     t_2
     (if (<= t_1 -2e+56)
       (/ (+ (fma t (* z (* a -4.0)) b) t_3) (* z c))
       (if (<= t_1 2000000000.0)
         (/ (+ (* a (* t -4.0)) (/ (+ b t_3) z)) c)
         (if (<= t_1 4e+303) 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) + (a * (t * (z * -4.0)))) + b) / (z * c);
	double t_2 = ((b / c) / z) + ((x / ((z * c) / (9.0 * y))) + ((a / (c / t)) * -4.0));
	double t_3 = x * (9.0 * y);
	double tmp;
	if (t_1 <= -5e+298) {
		tmp = t_2;
	} else if (t_1 <= -2e+56) {
		tmp = (fma(t, (z * (a * -4.0)), b) + t_3) / (z * c);
	} else if (t_1 <= 2000000000.0) {
		tmp = ((a * (t * -4.0)) + ((b + t_3) / z)) / c;
	} else if (t_1 <= 4e+303) {
		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(a * Float64(t * Float64(z * -4.0)))) + b) / Float64(z * c))
	t_2 = Float64(Float64(Float64(b / c) / z) + Float64(Float64(x / Float64(Float64(z * c) / Float64(9.0 * y))) + Float64(Float64(a / Float64(c / t)) * -4.0)))
	t_3 = Float64(x * Float64(9.0 * y))
	tmp = 0.0
	if (t_1 <= -5e+298)
		tmp = t_2;
	elseif (t_1 <= -2e+56)
		tmp = Float64(Float64(fma(t, Float64(z * Float64(a * -4.0)), b) + t_3) / Float64(z * c));
	elseif (t_1 <= 2000000000.0)
		tmp = Float64(Float64(Float64(a * Float64(t * -4.0)) + Float64(Float64(b + t_3) / z)) / c);
	elseif (t_1 <= 4e+303)
		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[(a * N[(t * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision] + N[(N[(x / N[(N[(z * c), $MachinePrecision] / N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+298], t$95$2, If[LessEqual[t$95$1, -2e+56], N[(N[(N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] + t$95$3), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2000000000.0], N[(N[(N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b + t$95$3), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 4e+303], 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 + a \cdot \left(t \cdot \left(z \cdot -4\right)\right)\right) + b}{z \cdot c}\\
t_2 := \frac{\frac{b}{c}}{z} + \left(\frac{x}{\frac{z \cdot c}{9 \cdot y}} + \frac{a}{\frac{c}{t}} \cdot -4\right)\\
t_3 := x \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+298}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right) + t_3}{z \cdot c}\\

\mathbf{elif}\;t_1 \leq 2000000000:\\
\;\;\;\;\frac{a \cdot \left(t \cdot -4\right) + \frac{b + t_3}{z}}{c}\\

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;t_1\\

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


\end{array}

Error?

Target

Original31.84%
Target21.7%
Herbie8.68%
\[\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 4 regimes
  2. if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -5.0000000000000003e298 or 4e303 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c))

    1. Initial program 96.52

      \[\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. Simplified82.1

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

      [Start]96.52

      \[ \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} \]

      associate-*l* [=>]96.42

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

      associate-*l* [=>]82.1

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

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

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

      [Start]44.08

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

      associate--l+ [=>]44.08

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

      associate-/r* [=>]46.19

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

      *-commutative [<=]46.19

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

      associate-*r/ [=>]46.34

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

      associate-*r* [=>]46.43

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

      *-commutative [<=]46.43

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

      associate-/l* [=>]31.56

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

      associate-/l* [=>]24.31

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

    if -5.0000000000000003e298 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -2.00000000000000018e56

    1. Initial program 0.9

      \[\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. Simplified8.21

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, \left(z \cdot a\right) \cdot -4, b\right)\right)}{z \cdot c}} \]
      Proof

      [Start]0.9

      \[ \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} \]

      associate-+l- [=>]0.9

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

      associate-*l* [=>]1.03

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

      fma-neg [=>]1.03

      \[ \frac{\color{blue}{\mathsf{fma}\left(x, 9 \cdot y, -\left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)\right)}}{z \cdot c} \]

      neg-sub0 [=>]1.03

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \color{blue}{0 - \left(\left(\left(z \cdot 4\right) \cdot t\right) \cdot a - b\right)}\right)}{z \cdot c} \]

      associate-+l- [<=]1.03

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \color{blue}{\left(0 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}\right)}{z \cdot c} \]

      neg-sub0 [<=]1.03

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

      distribute-lft-neg-in [=>]1.03

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

      *-commutative [=>]1.03

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

      distribute-lft-neg-in [=>]1.03

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

      associate-*r* [=>]8.21

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

      *-commutative [=>]8.21

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

      fma-def [=>]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \color{blue}{\mathsf{fma}\left(t, a \cdot \left(-z \cdot 4\right), b\right)}\right)}{z \cdot c} \]

      distribute-rgt-neg-in [<=]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, \color{blue}{-a \cdot \left(z \cdot 4\right)}, b\right)\right)}{z \cdot c} \]

      associate-*r* [=>]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, -\color{blue}{\left(a \cdot z\right) \cdot 4}, b\right)\right)}{z \cdot c} \]

      distribute-rgt-neg-in [=>]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, \color{blue}{\left(a \cdot z\right) \cdot \left(-4\right)}, b\right)\right)}{z \cdot c} \]

      *-commutative [=>]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, \color{blue}{\left(z \cdot a\right)} \cdot \left(-4\right), b\right)\right)}{z \cdot c} \]

      metadata-eval [=>]8.21

      \[ \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, \left(z \cdot a\right) \cdot \color{blue}{-4}, b\right)\right)}{z \cdot c} \]
    3. Applied egg-rr8.21

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t, z \cdot \left(a \cdot -4\right), b\right) + x \cdot \left(9 \cdot y\right)}}{z \cdot c} \]

    if -2.00000000000000018e56 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 2e9

    1. Initial program 17.93

      \[\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. Simplified1.73

      \[\leadsto \color{blue}{\frac{a \cdot \left(t \cdot -4\right) + \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}}{c}} \]
      Proof

      [Start]17.93

      \[ \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} \]

      associate-/r* [=>]2.3

      \[ \color{blue}{\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}} \]
    3. Applied egg-rr1.74

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

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

    1. Initial program 1.24

      \[\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} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification8.68

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

Alternatives

Alternative 1
Error7.15%
Cost6608
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y + a \cdot \left(t \cdot \left(z \cdot -4\right)\right)\right) + b}{z \cdot c}\\ t_2 := \frac{\frac{b}{c}}{z} + \left(\frac{x}{\frac{z \cdot c}{9 \cdot y}} + \frac{a}{\frac{c}{t}} \cdot -4\right)\\ \mathbf{if}\;t_1 \leq -4 \cdot 10^{+300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 2000000000:\\ \;\;\;\;\frac{a \cdot \left(t \cdot -4\right) + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error9.94%
Cost6352
\[\begin{array}{l} t_1 := \frac{\left(\left(x \cdot 9\right) \cdot y + a \cdot \left(t \cdot \left(z \cdot -4\right)\right)\right) + b}{z \cdot c}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 2000000000:\\ \;\;\;\;\frac{a \cdot \left(t \cdot -4\right) + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+303}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ \end{array} \]
Alternative 3
Error39.2%
Cost1762
\[\begin{array}{l} t_1 := \frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ t_2 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{+161}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5 \cdot 10^{+128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{+69}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{+61} \lor \neg \left(t \leq -160000\right) \land \left(t \leq -5.8 \cdot 10^{-33} \lor \neg \left(t \leq -1.25 \cdot 10^{-243}\right) \land t \leq 3.4 \cdot 10^{-288}\right):\\ \;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error24.21%
Cost1748
\[\begin{array}{l} t_1 := b + x \cdot \left(9 \cdot y\right)\\ t_2 := \frac{a \cdot \left(t \cdot -4\right) + \frac{t_1}{z}}{c}\\ \mathbf{if}\;z \leq -9000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-143}:\\ \;\;\;\;\frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ \mathbf{elif}\;z \leq 1.24 \cdot 10^{-290}:\\ \;\;\;\;\frac{t_1}{z \cdot c}\\ \mathbf{elif}\;z \leq 10^{-44}:\\ \;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+217}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \end{array} \]
Alternative 5
Error34.39%
Cost1624
\[\begin{array}{l} t_1 := \frac{9 \cdot \frac{y}{\frac{z}{x}} + \frac{b}{z}}{c}\\ t_2 := \frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ \mathbf{if}\;t \leq -92000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.1 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-157}:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t \leq -1.22 \cdot 10^{-234}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.3 \cdot 10^{-243}:\\ \;\;\;\;\frac{\frac{a}{\frac{-0.25}{t}}}{c}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-287}:\\ \;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error34.09%
Cost1624
\[\begin{array}{l} t_1 := \frac{9 \cdot \frac{y}{\frac{z}{x}} + \frac{b}{z}}{c}\\ t_2 := \frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ \mathbf{if}\;t \leq -92000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-159}:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t \leq -5.8 \cdot 10^{-230}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -9.6 \cdot 10^{-244}:\\ \;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-287}:\\ \;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error34.58%
Cost1624
\[\begin{array}{l} t_1 := 9 \cdot \frac{y}{\frac{z}{x}}\\ t_2 := \frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ t_3 := a \cdot \left(t \cdot -4\right)\\ \mathbf{if}\;t \leq -2600000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{t_3 + t_1}{c}\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{-150}:\\ \;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-172}:\\ \;\;\;\;\frac{t_3 + \frac{9}{z} \cdot \left(x \cdot y\right)}{c}\\ \mathbf{elif}\;t \leq -1 \cdot 10^{-227}:\\ \;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-289}:\\ \;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error36.82%
Cost1492
\[\begin{array}{l} t_1 := \frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ t_2 := \frac{\frac{b}{c}}{z} + \frac{a}{\frac{c}{t}} \cdot -4\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{+151}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4 \cdot 10^{+64}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-12}:\\ \;\;\;\;\frac{a \cdot \left(t \cdot -4\right) + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\ \mathbf{elif}\;x \leq 4.9 \cdot 10^{-141}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error16.33%
Cost1484
\[\begin{array}{l} t_1 := x \cdot \left(9 \cdot y\right)\\ t_2 := \frac{a \cdot \left(t \cdot -4\right) + \frac{b + t_1}{z}}{c}\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{-22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{b + \left(t_1 + \left(t \cdot a\right) \cdot \left(z \cdot -4\right)\right)}{z \cdot c}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+217}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \end{array} \]
Alternative 10
Error54.17%
Cost1372
\[\begin{array}{l} t_1 := 9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\ \mathbf{if}\;t \leq -92000:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -4.1 \cdot 10^{-112}:\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\ \mathbf{elif}\;t \leq -7.8 \cdot 10^{-152}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;t \leq -3.7 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-291}:\\ \;\;\;\;b \cdot \frac{\frac{1}{z}}{c}\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t \cdot -4}{c}\\ \end{array} \]
Alternative 11
Error33.99%
Cost1364
\[\begin{array}{l} t_1 := \frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ t_2 := \frac{a}{\frac{c}{t}} \cdot -4\\ t_3 := \frac{x}{z} \cdot \frac{9 \cdot y}{c}\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{-44}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+138}:\\ \;\;\;\;\frac{\frac{b}{c}}{z} + t_2\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{+242}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{+257}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+283}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error40.47%
Cost1232
\[\begin{array}{l} t_1 := \frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\ \mathbf{if}\;a \leq -1.25 \cdot 10^{-44}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;a \leq 14200000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 10^{+83}:\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+125}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t \cdot -4}{c}\\ \end{array} \]
Alternative 13
Error55.6%
Cost976
\[\begin{array}{l} t_1 := \frac{\frac{b}{c}}{z}\\ \mathbf{if}\;a \leq -6.8 \cdot 10^{-52}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;a \leq -9.5 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-171}:\\ \;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\ \mathbf{elif}\;a \leq 6400000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t \cdot -4}{c}\\ \end{array} \]
Alternative 14
Error55.44%
Cost976
\[\begin{array}{l} t_1 := \frac{\frac{b}{c}}{z}\\ \mathbf{if}\;a \leq -5.8 \cdot 10^{-47}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-214}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-211}:\\ \;\;\;\;9 \cdot \frac{y}{\frac{z \cdot c}{x}}\\ \mathbf{elif}\;a \leq 340000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t \cdot -4}{c}\\ \end{array} \]
Alternative 15
Error54.07%
Cost713
\[\begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{-46} \lor \neg \left(a \leq 4200000\right):\\ \;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \end{array} \]
Alternative 16
Error54.11%
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-46}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;a \leq 6800000:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\ \end{array} \]
Alternative 17
Error54.08%
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{-47}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;a \leq 40000000:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{\frac{c}{t}} \cdot -4\\ \end{array} \]
Alternative 18
Error54%
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{-48}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;a \leq 16500000000:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t \cdot -4}{c}\\ \end{array} \]
Alternative 19
Error67.77%
Cost320
\[\frac{b}{z \cdot c} \]
Alternative 20
Error68.15%
Cost320
\[\frac{\frac{b}{c}}{z} \]

Error

Reproduce?

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