Average Error: 8.0 → 0.4
Time: 15.8s
Precision: binary64
Cost: 9680
\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \end{array} \]
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
\[\begin{array}{l} t_1 := \frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{+285}:\\ \;\;\;\;\mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \frac{y \cdot 0.5}{\frac{a}{x}}\right)\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-231}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{elif}\;t_2 \leq 10^{-321}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+245}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ (* (/ y a) (/ x 2.0)) (* t (* z (/ -4.5 a)))))
        (t_2 (+ (* x y) (* t (* z -9.0)))))
   (if (<= t_2 -2e+285)
     (fma -4.5 (* z (/ t a)) (/ (* y 0.5) (/ a x)))
     (if (<= t_2 -1e-231)
       (/ t_2 (* a 2.0))
       (if (<= t_2 1e-321)
         t_1
         (if (<= t_2 1e+245) (/ (fma x y (* z (* t -9.0))) (* a 2.0)) t_1))))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y / a) * (x / 2.0)) + (t * (z * (-4.5 / a)));
	double t_2 = (x * y) + (t * (z * -9.0));
	double tmp;
	if (t_2 <= -2e+285) {
		tmp = fma(-4.5, (z * (t / a)), ((y * 0.5) / (a / x)));
	} else if (t_2 <= -1e-231) {
		tmp = t_2 / (a * 2.0);
	} else if (t_2 <= 1e-321) {
		tmp = t_1;
	} else if (t_2 <= 1e+245) {
		tmp = fma(x, y, (z * (t * -9.0))) / (a * 2.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0))
end
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(y / a) * Float64(x / 2.0)) + Float64(t * Float64(z * Float64(-4.5 / a))))
	t_2 = Float64(Float64(x * y) + Float64(t * Float64(z * -9.0)))
	tmp = 0.0
	if (t_2 <= -2e+285)
		tmp = fma(-4.5, Float64(z * Float64(t / a)), Float64(Float64(y * 0.5) / Float64(a / x)));
	elseif (t_2 <= -1e-231)
		tmp = Float64(t_2 / Float64(a * 2.0));
	elseif (t_2 <= 1e-321)
		tmp = t_1;
	elseif (t_2 <= 1e+245)
		tmp = Float64(fma(x, y, Float64(z * Float64(t * -9.0))) / Float64(a * 2.0));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+285], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision] + N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-231], N[(t$95$2 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-321], t$95$1, If[LessEqual[t$95$2, 1e+245], N[(N[(x * y + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\
t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+285}:\\
\;\;\;\;\mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \frac{y \cdot 0.5}{\frac{a}{x}}\right)\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-231}:\\
\;\;\;\;\frac{t_2}{a \cdot 2}\\

\mathbf{elif}\;t_2 \leq 10^{-321}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Target

Original8.0
Target5.5
Herbie0.4
\[\begin{array}{l} \mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \end{array} \]

Derivation

  1. Split input into 4 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -2e285

    1. Initial program 51.9

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (*.f64 t -9))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (*.f64 t (Rewrite<= metadata-eval (neg.f64 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 t 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 z 9) t)))) (*.f64 a 2)): 10 points increase in error, 17 points decrease in error
      (/.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))) (*.f64 a 2)): 3 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 (*.f64 x y) 0)) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (+.f64 (*.f64 x y) 0) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2)))): 1 points increase in error, 4 points decrease in error
      (-.f64 (/.f64 (Rewrite=> +-rgt-identity_binary64 (*.f64 x y)) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2))): 4 points increase in error, 1 points decrease in error
    3. Taylor expanded in x around 0 51.3

      \[\leadsto \color{blue}{-4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a}} \]
    4. Simplified0.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(-4.5, \frac{t}{a} \cdot z, \frac{0.5 \cdot y}{\frac{a}{x}}\right)} \]
      Proof
      (fma.f64 -9/2 (*.f64 (/.f64 t a) z) (/.f64 (*.f64 1/2 y) (/.f64 a x))): 0 points increase in error, 0 points decrease in error
      (fma.f64 -9/2 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 t z) a)) (/.f64 (*.f64 1/2 y) (/.f64 a x))): 31 points increase in error, 29 points decrease in error
      (fma.f64 -9/2 (/.f64 (*.f64 t z) a) (Rewrite<= associate-*r/_binary64 (*.f64 1/2 (/.f64 y (/.f64 a x))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 -9/2 (/.f64 (*.f64 t z) a) (*.f64 1/2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y x) a)))): 28 points increase in error, 33 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 -9/2 (/.f64 (*.f64 t z) a)) (*.f64 1/2 (/.f64 (*.f64 y x) a)))): 1 points increase in error, 4 points decrease in error

    if -2e285 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -9.9999999999999999e-232

    1. Initial program 0.3

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

    if -9.9999999999999999e-232 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 9.98013e-322 or 1.00000000000000004e245 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 31.5

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
    2. Applied egg-rr31.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{a}, \frac{x \cdot y}{2}, -\left(9 \cdot \left(z \cdot t\right)\right) \cdot \frac{0.5}{a}\right)} \]
    3. Simplified18.1

      \[\leadsto \color{blue}{\frac{y}{a} \cdot \frac{x}{2} - \frac{\left(t \cdot z\right) \cdot 4.5}{a}} \]
      Proof
      (-.f64 (*.f64 (/.f64 y a) (/.f64 x 2)) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 x 2) (/.f64 y a))) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (/.f64 x 2) y) a)) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 30 points increase in error, 39 points decrease in error
      (-.f64 (/.f64 (Rewrite<= associate-/r/_binary64 (/.f64 x (/.f64 2 y))) a) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 17 points increase in error, 3 points decrease in error
      (-.f64 (/.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x y) 2)) a) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 3 points increase in error, 17 points decrease in error
      (-.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (*.f64 x y) 2))) a) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2))) (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 17 points increase in error, 10 points decrease in error
      (-.f64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2)) (/.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 z t)) 9/2) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2)) (/.f64 (*.f64 (*.f64 z t) (Rewrite<= metadata-eval (*.f64 9 1/2))) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2)) (/.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 z t) 9) 1/2)) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2)) (/.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 9 (*.f64 z t))) 1/2) a)): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2)) (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 9 (*.f64 z t)) (/.f64 1/2 a)))): 21 points increase in error, 8 points decrease in error
      (Rewrite=> fma-neg_binary64 (fma.f64 (/.f64 1 a) (/.f64 (*.f64 x y) 2) (neg.f64 (*.f64 (*.f64 9 (*.f64 z t)) (/.f64 1/2 a))))): 0 points increase in error, 2 points decrease in error
    4. Taylor expanded in t around 0 18.0

      \[\leadsto \frac{y}{a} \cdot \frac{x}{2} - \color{blue}{4.5 \cdot \frac{t \cdot z}{a}} \]
    5. Simplified0.8

      \[\leadsto \frac{y}{a} \cdot \frac{x}{2} - \color{blue}{t \cdot \left(z \cdot \frac{4.5}{a}\right)} \]
      Proof
      (*.f64 t (*.f64 z (/.f64 9/2 a))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 t z) (/.f64 9/2 a))): 49 points increase in error, 47 points decrease in error
      (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (*.f64 t z) 9/2) a)): 24 points increase in error, 36 points decrease in error
      (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 (*.f64 t z) a) 9/2)): 38 points increase in error, 22 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 9/2 (/.f64 (*.f64 t z) a))): 0 points increase in error, 0 points decrease in error

    if 9.98013e-322 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 1.00000000000000004e245

    1. Initial program 0.3

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}} \]
      Proof
      (/.f64 (fma.f64 x y (*.f64 z (*.f64 t -9))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (*.f64 t (Rewrite<= metadata-eval (neg.f64 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 t 9))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (*.f64 z (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z (*.f64 9 t))))) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 x y (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 z 9) t)))) (*.f64 a 2)): 10 points increase in error, 17 points decrease in error
      (/.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))) (*.f64 a 2)): 3 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 (*.f64 x y) 0)) (*.f64 (*.f64 z 9) t)) (*.f64 a 2)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (+.f64 (*.f64 x y) 0) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2)))): 1 points increase in error, 4 points decrease in error
      (-.f64 (/.f64 (Rewrite=> +-rgt-identity_binary64 (*.f64 x y)) (*.f64 a 2)) (/.f64 (*.f64 (*.f64 z 9) t) (*.f64 a 2))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) (*.f64 a 2))): 4 points increase in error, 1 points decrease in error
  3. Recombined 4 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y + t \cdot \left(z \cdot -9\right) \leq -2 \cdot 10^{+285}:\\ \;\;\;\;\mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, \frac{y \cdot 0.5}{\frac{a}{x}}\right)\\ \mathbf{elif}\;x \cdot y + t \cdot \left(z \cdot -9\right) \leq -1 \cdot 10^{-231}:\\ \;\;\;\;\frac{x \cdot y + t \cdot \left(z \cdot -9\right)}{a \cdot 2}\\ \mathbf{elif}\;x \cdot y + t \cdot \left(z \cdot -9\right) \leq 10^{-321}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ \mathbf{elif}\;x \cdot y + t \cdot \left(z \cdot -9\right) \leq 10^{+245}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error0.8
Cost9680
\[\begin{array}{l} t_1 := \frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-231}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{elif}\;t_2 \leq 10^{-321}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error0.4
Cost9680
\[\begin{array}{l} t_1 := \frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-231}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{elif}\;t_2 \leq 10^{-321}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+245}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error0.4
Cost3536
\[\begin{array}{l} t_1 := \frac{y}{a} \cdot \frac{x}{2} + t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ t_3 := \frac{t_2}{a \cdot 2}\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-231}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 10^{+245}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error5.2
Cost2120
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+271}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error23.7
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ t_2 := -4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{if}\;t \leq -3.5 \cdot 10^{-102}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 1.78 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
Alternative 6
Error23.7
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{if}\;t \leq -2.8 \cdot 10^{-102}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{+75}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+108}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
Alternative 7
Error23.3
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{if}\;t \leq -1.1 \cdot 10^{-102}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{+53}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{+75}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{+108}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
Alternative 8
Error23.2
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{if}\;t \leq -3.3 \cdot 10^{-102}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+74}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+115}:\\ \;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
Alternative 9
Error23.2
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{if}\;t \leq -1.45 \cdot 10^{-102}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 1.72 \cdot 10^{+53}:\\ \;\;\;\;\frac{x \cdot y}{a \cdot 2}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+74}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a}\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{+95}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+115}:\\ \;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \end{array} \]
Alternative 10
Error32.3
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+72}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \end{array} \]
Alternative 11
Error32.9
Cost448
\[-4.5 \cdot \left(z \cdot \frac{t}{a}\right) \]
Alternative 12
Error32.6
Cost448
\[-4.5 \cdot \left(t \cdot \frac{z}{a}\right) \]

Error

Reproduce

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

  :herbie-target
  (if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))