?

Average Accuracy: 67.9% → 90.4%
Time: 34.5s
Precision: binary64
Cost: 18896

?

\[ \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 := \mathsf{fma}\left(x, 9 \cdot y, b\right)\\ t_2 := t \cdot \left(a \cdot -4\right)\\ t_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}\\ t_4 := \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(a, t \cdot \left(z \cdot -4\right), b\right)\right)}{z \cdot c}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\frac{{\left(\frac{z}{t_1}\right)}^{-1} + t_2}{c}\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-38}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+14}:\\ \;\;\;\;\frac{t_2 + t_1 \cdot \frac{1}{z}}{c}\\ \mathbf{elif}\;t_3 \leq 10^{+300}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \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 (fma x (* 9.0 y) b))
        (t_2 (* t (* a -4.0)))
        (t_3 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
        (t_4 (/ (fma x (* 9.0 y) (fma a (* t (* z -4.0)) b)) (* z c))))
   (if (<= t_3 (- INFINITY))
     (/ (+ (pow (/ z t_1) -1.0) t_2) c)
     (if (<= t_3 -2e-38)
       t_4
       (if (<= t_3 5e+14)
         (/ (+ t_2 (* t_1 (/ 1.0 z))) c)
         (if (<= t_3 1e+300) t_4 (/ (+ t_2 (* (* 9.0 y) (/ x z))) c)))))))
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 = fma(x, (9.0 * y), b);
	double t_2 = t * (a * -4.0);
	double t_3 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
	double t_4 = fma(x, (9.0 * y), fma(a, (t * (z * -4.0)), b)) / (z * c);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = (pow((z / t_1), -1.0) + t_2) / c;
	} else if (t_3 <= -2e-38) {
		tmp = t_4;
	} else if (t_3 <= 5e+14) {
		tmp = (t_2 + (t_1 * (1.0 / z))) / c;
	} else if (t_3 <= 1e+300) {
		tmp = t_4;
	} else {
		tmp = (t_2 + ((9.0 * y) * (x / z))) / c;
	}
	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 = fma(x, Float64(9.0 * y), b)
	t_2 = Float64(t * Float64(a * -4.0))
	t_3 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c))
	t_4 = Float64(fma(x, Float64(9.0 * y), fma(a, Float64(t * Float64(z * -4.0)), b)) / Float64(z * c))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64((Float64(z / t_1) ^ -1.0) + t_2) / c);
	elseif (t_3 <= -2e-38)
		tmp = t_4;
	elseif (t_3 <= 5e+14)
		tmp = Float64(Float64(t_2 + Float64(t_1 * Float64(1.0 / z))) / c);
	elseif (t_3 <= 1e+300)
		tmp = t_4;
	else
		tmp = Float64(Float64(t_2 + Float64(Float64(9.0 * y) * Float64(x / z))) / c);
	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[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(a * N[(t * N[(z * -4.0), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[Power[N[(z / t$95$1), $MachinePrecision], -1.0], $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$3, -2e-38], t$95$4, If[LessEqual[t$95$3, 5e+14], N[(N[(t$95$2 + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$3, 1e+300], t$95$4, N[(N[(t$95$2 + N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]]]
\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 := \mathsf{fma}\left(x, 9 \cdot y, b\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_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}\\
t_4 := \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(a, t \cdot \left(z \cdot -4\right), b\right)\right)}{z \cdot c}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\frac{{\left(\frac{z}{t_1}\right)}^{-1} + t_2}{c}\\

\mathbf{elif}\;t_3 \leq -2 \cdot 10^{-38}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+14}:\\
\;\;\;\;\frac{t_2 + t_1 \cdot \frac{1}{z}}{c}\\

\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\frac{t_2 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\


\end{array}

Error?

Target

Original67.9%
Target77.3%
Herbie90.4%
\[\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)) < -inf.0

    1. Initial program 0.0%

      \[\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. Simplified60.7%

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

      [Start]0.0

      \[ \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* [=>]8.9

      \[ \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-rr60.7%

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

      [Start]60.7

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

      clear-num [=>]60.7

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

      inv-pow [=>]60.7

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

    if -inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -1.9999999999999999e-38 or 5e14 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 1.0000000000000001e300

    1. Initial program 99.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} \]
    2. Simplified99.0%

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

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

      associate-+l- [=>]99.1

      \[ \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* [=>]99.0

      \[ \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 [=>]99.0

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

      sub-neg [=>]99.0

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

      distribute-neg-in [=>]99.0

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

      *-commutative [=>]99.0

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

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

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

      fma-def [=>]99.0

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

      *-commutative [=>]99.0

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

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

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

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

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

      metadata-eval [=>]99.0

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

      remove-double-neg [=>]99.0

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

    if -1.9999999999999999e-38 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 5e14

    1. Initial program 77.5%

      \[\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. Simplified98.4%

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

      [Start]77.5

      \[ \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* [=>]98.2

      \[ \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-rr98.3%

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

      [Start]98.4

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

      div-inv [=>]98.3

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

    if 1.0000000000000001e300 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c))

    1. Initial program 2.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. Simplified58.7%

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

      [Start]2.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-/r* [=>]6.0

      \[ \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. Taylor expanded in x around inf 53.0%

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

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

      [Start]53.0

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

      associate-/l* [=>]69.0

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

      associate-*r/ [=>]68.8

      \[ \frac{\color{blue}{\frac{9 \cdot y}{\frac{z}{x}}} + t \cdot \left(a \cdot -4\right)}{c} \]
    5. Applied egg-rr68.8%

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

      [Start]68.8

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

      clear-num [=>]68.8

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

      associate-/r/ [=>]68.8

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

      clear-num [<=]68.8

      \[ \frac{\color{blue}{\frac{x}{z}} \cdot \left(9 \cdot y\right) + t \cdot \left(a \cdot -4\right)}{c} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.4%

    \[\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{{\left(\frac{z}{\mathsf{fma}\left(x, 9 \cdot y, b\right)}\right)}^{-1} + t \cdot \left(a \cdot -4\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^{-38}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(a, t \cdot \left(z \cdot -4\right), b\right)\right)}{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 5 \cdot 10^{+14}:\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \mathsf{fma}\left(x, 9 \cdot y, b\right) \cdot \frac{1}{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} \leq 10^{+300}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(a, t \cdot \left(z \cdot -4\right), b\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy90.4%
Cost18896
\[\begin{array}{l} t_1 := t \cdot \left(a \cdot -4\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 := \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(a, t \cdot \left(z \cdot -4\right), b\right)\right)}{z \cdot c}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;\frac{t_1 + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-38}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+14}:\\ \;\;\;\;\frac{t_1 + \mathsf{fma}\left(x, 9 \cdot y, b\right) \cdot \frac{1}{z}}{c}\\ \mathbf{elif}\;t_2 \leq 10^{+300}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \end{array} \]
Alternative 2
Accuracy90.4%
Cost11340
\[\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 := t \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{t_2 + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+14}:\\ \;\;\;\;\frac{t_2 + \mathsf{fma}\left(x, 9 \cdot y, b\right) \cdot \frac{1}{z}}{c}\\ \mathbf{elif}\;t_1 \leq 10^{+300}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \end{array} \]
Alternative 3
Accuracy88.9%
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}\\ t_2 := t \cdot \left(a \cdot -4\right)\\ t_3 := \frac{t_2 + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{+163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+14}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 10^{+300}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \end{array} \]
Alternative 4
Accuracy82.3%
Cost2380
\[\begin{array}{l} t_1 := x \cdot \left(9 \cdot y\right)\\ t_2 := \left(x \cdot 9\right) \cdot y\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{+162}:\\ \;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-24}:\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b + t_1}{z}}{c}\\ \mathbf{elif}\;t_2 \leq 10^{+250}:\\ \;\;\;\;\frac{b + \left(t_1 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(9 \cdot \left(\frac{y}{z} \cdot \frac{1}{c}\right)\right)\\ \end{array} \]
Alternative 5
Accuracy57.0%
Cost2024
\[\begin{array}{l} t_1 := \frac{-4}{\frac{c}{t \cdot a}}\\ t_2 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ t_3 := -4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+112}:\\ \;\;\;\;\frac{1}{c \cdot \frac{z}{b}}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+70}:\\ \;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-64}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-108}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+55}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+130}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+228}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+251}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+261}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Accuracy42.4%
Cost1900
\[\begin{array}{l} t_1 := 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\ t_2 := \frac{b}{z \cdot c}\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+167}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{+115}:\\ \;\;\;\;\frac{1}{c \cdot \frac{z}{b}}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+68}:\\ \;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{+32}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-199}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-89}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+130}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{\frac{c}{t \cdot a}}\\ \end{array} \]
Alternative 7
Accuracy68.7%
Cost1624
\[\begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := \frac{t_1 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ t_3 := \frac{t_1 + \frac{b}{z}}{c}\\ \mathbf{if}\;z \leq -4 \cdot 10^{-109}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-43}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+114}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{+156}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+228}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.34 \cdot 10^{+244}:\\ \;\;\;\;\frac{\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 8
Accuracy68.6%
Cost1624
\[\begin{array}{l} t_1 := t \cdot \left(a \cdot -4\right)\\ t_2 := \frac{t_1 + \frac{b}{z}}{c}\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{-108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+113}:\\ \;\;\;\;\frac{t_1 + \frac{9 \cdot y}{\frac{z}{x}}}{c}\\ \mathbf{elif}\;z \leq 1.46 \cdot 10^{+156}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+228}:\\ \;\;\;\;\frac{t_1 + \left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\ \mathbf{elif}\;z \leq 1.34 \cdot 10^{+244}:\\ \;\;\;\;\frac{\frac{b}{z} + 9 \cdot \frac{x \cdot y}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Accuracy43.6%
Cost1505
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+117}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{+35}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-51} \lor \neg \left(z \leq 5.2 \cdot 10^{+130}\right) \land z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Accuracy43.6%
Cost1505
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+116}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-51} \lor \neg \left(z \leq 5.2 \cdot 10^{+130}\right) \land z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Accuracy43.6%
Cost1504
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\ t_2 := \frac{b}{z \cdot c}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+115}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.82 \cdot 10^{+31}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.32 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-55}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+130}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Accuracy43.9%
Cost1504
\[\begin{array}{l} t_1 := \frac{-4}{\frac{c}{t \cdot a}}\\ t_2 := \frac{b}{z \cdot c}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{+114}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+129}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Accuracy44.0%
Cost1504
\[\begin{array}{l} t_1 := \frac{-4}{\frac{c}{t \cdot a}}\\ t_2 := \frac{b}{z \cdot c}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+164}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+116}:\\ \;\;\;\;\frac{1}{c \cdot \frac{z}{b}}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+31}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+130}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Accuracy44.0%
Cost1504
\[\begin{array}{l} t_1 := \frac{b}{z \cdot c}\\ \mathbf{if}\;z \leq -5.2 \cdot 10^{+165}:\\ \;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+115}:\\ \;\;\;\;\frac{1}{c \cdot \frac{z}{b}}\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+70}:\\ \;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+33}:\\ \;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-133}:\\ \;\;\;\;a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+130}:\\ \;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{\frac{c}{t \cdot a}}\\ \end{array} \]
Alternative 15
Accuracy83.0%
Cost1353
\[\begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{-109} \lor \neg \left(z \leq 6.5 \cdot 10^{-84}\right):\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b + x \cdot \left(9 \cdot y\right)}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \end{array} \]
Alternative 16
Accuracy43.4%
Cost1242
\[\begin{array}{l} t_1 := a \cdot \left(t \cdot \frac{-4}{c}\right)\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{+35}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \mathbf{elif}\;z \leq -1.56 \cdot 10^{-133} \lor \neg \left(z \leq 5.1 \cdot 10^{-54} \lor \neg \left(z \leq 5.2 \cdot 10^{+130}\right) \land z \leq 1.15 \cdot 10^{+154}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \end{array} \]
Alternative 17
Accuracy69.9%
Cost969
\[\begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-108} \lor \neg \left(z \leq 4.5 \cdot 10^{+54}\right):\\ \;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\ \end{array} \]
Alternative 18
Accuracy32.8%
Cost585
\[\begin{array}{l} \mathbf{if}\;c \leq -9.5 \cdot 10^{+83} \lor \neg \left(c \leq 1.8 \cdot 10^{-179}\right):\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{z}}{c}\\ \end{array} \]
Alternative 19
Accuracy31.2%
Cost452
\[\begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{+38}:\\ \;\;\;\;\frac{b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{c}}{z}\\ \end{array} \]
Alternative 20
Accuracy31.6%
Cost320
\[\frac{b}{z \cdot c} \]

Error

Reproduce?

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