?

Average Error: 8.0 → 0.9
Time: 15.2s
Precision: binary64
Cost: 3536

?

\[ \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 := 0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ t_2 := x \cdot y - \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-117}:\\ \;\;\;\;\frac{0.5}{\frac{a}{x \cdot y - 9 \cdot \left(z \cdot t\right)}}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-205}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right) + 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\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 (+ (* 0.5 (/ y (/ a x))) (* -4.5 (* z (/ t a)))))
        (t_2 (- (* x y) (* (* z 9.0) t))))
   (if (<= t_2 -5e+169)
     t_1
     (if (<= t_2 -1e-117)
       (/ 0.5 (/ a (- (* x y) (* 9.0 (* z t)))))
       (if (<= t_2 5e-205)
         (+ (* -4.5 (* t (/ z a))) (* 0.5 (* y (/ x a))))
         (if (<= t_2 4e+218)
           (/ (- (* x y) (* z (* 9.0 t))) (* 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 = (0.5 * (y / (a / x))) + (-4.5 * (z * (t / a)));
	double t_2 = (x * y) - ((z * 9.0) * t);
	double tmp;
	if (t_2 <= -5e+169) {
		tmp = t_1;
	} else if (t_2 <= -1e-117) {
		tmp = 0.5 / (a / ((x * y) - (9.0 * (z * t))));
	} else if (t_2 <= 5e-205) {
		tmp = (-4.5 * (t * (z / a))) + (0.5 * (y * (x / a)));
	} else if (t_2 <= 4e+218) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (0.5d0 * (y / (a / x))) + ((-4.5d0) * (z * (t / a)))
    t_2 = (x * y) - ((z * 9.0d0) * t)
    if (t_2 <= (-5d+169)) then
        tmp = t_1
    else if (t_2 <= (-1d-117)) then
        tmp = 0.5d0 / (a / ((x * y) - (9.0d0 * (z * t))))
    else if (t_2 <= 5d-205) then
        tmp = ((-4.5d0) * (t * (z / a))) + (0.5d0 * (y * (x / a)))
    else if (t_2 <= 4d+218) then
        tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (0.5 * (y / (a / x))) + (-4.5 * (z * (t / a)));
	double t_2 = (x * y) - ((z * 9.0) * t);
	double tmp;
	if (t_2 <= -5e+169) {
		tmp = t_1;
	} else if (t_2 <= -1e-117) {
		tmp = 0.5 / (a / ((x * y) - (9.0 * (z * t))));
	} else if (t_2 <= 5e-205) {
		tmp = (-4.5 * (t * (z / a))) + (0.5 * (y * (x / a)));
	} else if (t_2 <= 4e+218) {
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
def code(x, y, z, t, a):
	t_1 = (0.5 * (y / (a / x))) + (-4.5 * (z * (t / a)))
	t_2 = (x * y) - ((z * 9.0) * t)
	tmp = 0
	if t_2 <= -5e+169:
		tmp = t_1
	elif t_2 <= -1e-117:
		tmp = 0.5 / (a / ((x * y) - (9.0 * (z * t))))
	elif t_2 <= 5e-205:
		tmp = (-4.5 * (t * (z / a))) + (0.5 * (y * (x / a)))
	elif t_2 <= 4e+218:
		tmp = ((x * y) - (z * (9.0 * t))) / (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(0.5 * Float64(y / Float64(a / x))) + Float64(-4.5 * Float64(z * Float64(t / a))))
	t_2 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t))
	tmp = 0.0
	if (t_2 <= -5e+169)
		tmp = t_1;
	elseif (t_2 <= -1e-117)
		tmp = Float64(0.5 / Float64(a / Float64(Float64(x * y) - Float64(9.0 * Float64(z * t)))));
	elseif (t_2 <= 5e-205)
		tmp = Float64(Float64(-4.5 * Float64(t * Float64(z / a))) + Float64(0.5 * Float64(y * Float64(x / a))));
	elseif (t_2 <= 4e+218)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (0.5 * (y / (a / x))) + (-4.5 * (z * (t / a)));
	t_2 = (x * y) - ((z * 9.0) * t);
	tmp = 0.0;
	if (t_2 <= -5e+169)
		tmp = t_1;
	elseif (t_2 <= -1e-117)
		tmp = 0.5 / (a / ((x * y) - (9.0 * (z * t))));
	elseif (t_2 <= 5e-205)
		tmp = (-4.5 * (t * (z / a))) + (0.5 * (y * (x / a)));
	elseif (t_2 <= 4e+218)
		tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
	else
		tmp = t_1;
	end
	tmp_2 = 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[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+169], t$95$1, If[LessEqual[t$95$2, -1e-117], N[(0.5 / N[(a / N[(N[(x * y), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-205], N[(N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+218], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $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 := 0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
t_2 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+169}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-117}:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y - 9 \cdot \left(z \cdot t\right)}}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{-205}:\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right) + 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original8.0
Target5.6
Herbie0.9
\[\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)) < -5.00000000000000017e169 or 4.00000000000000033e218 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 27.9

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

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

      [Start]27.9

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

      rational.json-simplify-2 [=>]27.9

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

      rational.json-simplify-43 [=>]27.8

      \[ \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Taylor expanded in x around 0 27.6

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

      \[\leadsto \color{blue}{\left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) + x \cdot \left(0.5 \cdot \frac{y}{a}\right)\right) - 0} \]
    5. Simplified1.5

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

      [Start]1.4

      \[ \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) + x \cdot \left(0.5 \cdot \frac{y}{a}\right)\right) - 0 \]

      rational.json-simplify-48 [=>]1.4

      \[ \color{blue}{x \cdot \left(0.5 \cdot \frac{y}{a}\right) + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right)} \]

      rational.json-simplify-43 [=>]1.4

      \[ \color{blue}{0.5 \cdot \left(\frac{y}{a} \cdot x\right)} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-2 [<=]1.4

      \[ 0.5 \cdot \color{blue}{\left(x \cdot \frac{y}{a}\right)} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-49 [<=]15.1

      \[ 0.5 \cdot \color{blue}{\frac{y \cdot x}{a}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-7 [<=]15.1

      \[ 0.5 \cdot \frac{y \cdot x}{\color{blue}{\frac{a}{1}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-61 [=>]15.1

      \[ 0.5 \cdot \color{blue}{\frac{1}{\frac{a}{y \cdot x}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-2 [=>]15.1

      \[ 0.5 \cdot \frac{1}{\frac{a}{\color{blue}{x \cdot y}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-46 [=>]1.4

      \[ 0.5 \cdot \frac{1}{\color{blue}{\frac{\frac{a}{x}}{y}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-61 [=>]1.4

      \[ 0.5 \cdot \color{blue}{\frac{y}{\frac{\frac{a}{x}}{1}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-7 [=>]1.4

      \[ 0.5 \cdot \frac{y}{\color{blue}{\frac{a}{x}}} + \left(t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - 0\right) \]

      rational.json-simplify-5 [=>]1.4

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

      rational.json-simplify-43 [=>]1.4

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

      rational.json-simplify-2 [=>]1.4

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

      rational.json-simplify-49 [<=]15.3

      \[ 0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \color{blue}{\frac{z \cdot t}{a}} \]

      rational.json-simplify-2 [<=]15.3

      \[ 0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \frac{\color{blue}{t \cdot z}}{a} \]

      rational.json-simplify-49 [=>]1.5

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

    if -5.00000000000000017e169 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -1.00000000000000003e-117

    1. Initial program 0.3

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

      \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \left(x \cdot y - 9 \cdot \left(z \cdot t\right)\right)} \]
    3. Applied egg-rr0.5

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

    if -1.00000000000000003e-117 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.00000000000000001e-205

    1. Initial program 6.3

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

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

      [Start]6.3

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

      rational.json-simplify-2 [=>]6.3

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

      rational.json-simplify-43 [=>]6.3

      \[ \frac{x \cdot y - \color{blue}{z \cdot \left(9 \cdot t\right)}}{a \cdot 2} \]
    3. Taylor expanded in x around 0 6.4

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

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

      [Start]6.4

      \[ -4.5 \cdot \frac{t \cdot z}{a} + 0.5 \cdot \frac{y \cdot x}{a} \]

      rational.json-simplify-2 [=>]6.4

      \[ -4.5 \cdot \frac{\color{blue}{z \cdot t}}{a} + 0.5 \cdot \frac{y \cdot x}{a} \]

      rational.json-simplify-49 [=>]4.5

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

      rational.json-simplify-2 [<=]4.5

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

      rational.json-simplify-49 [=>]2.5

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

    if 5.00000000000000001e-205 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 4.00000000000000033e218

    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{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}} \]
      Proof

      [Start]0.3

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

      rational.json-simplify-2 [=>]0.3

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

      rational.json-simplify-43 [=>]0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq -5 \cdot 10^{+169}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq -1 \cdot 10^{-117}:\\ \;\;\;\;\frac{0.5}{\frac{a}{x \cdot y - 9 \cdot \left(z \cdot t\right)}}\\ \mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 5 \cdot 10^{-205}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right) + 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \mathbf{elif}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 4 \cdot 10^{+218}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}} + -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error0.6
Cost3536
\[\begin{array}{l} t_1 := -4.5 \cdot \left(t \cdot \frac{z}{a}\right) + 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ t_2 := x \cdot y - \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{+293}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-205}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+234}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error5.0
Cost2384
\[\begin{array}{l} t_1 := \left(z \cdot 9\right) \cdot t\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+285}:\\ \;\;\;\;\frac{-4.5}{\frac{\frac{a}{t}}{z}}\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{-303}:\\ \;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{-313}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+166}:\\ \;\;\;\;\frac{0.5}{\frac{a}{x \cdot y - 9 \cdot \left(z \cdot t\right)}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 3
Error4.7
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+272}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+255}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(x \cdot y - 9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \end{array} \]
Alternative 4
Error4.8
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+272}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+255}:\\ \;\;\;\;\frac{0.5}{\frac{a}{x \cdot y - 9 \cdot \left(z \cdot t\right)}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \end{array} \]
Alternative 5
Error4.6
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+272}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+255}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\ \end{array} \]
Alternative 6
Error26.8
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ t_2 := -4.5 \cdot \frac{t \cdot z}{a}\\ t_3 := -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+155}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+65}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-116}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 7
Error26.7
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ t_2 := -4.5 \cdot \frac{t \cdot z}{a}\\ t_3 := -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{if}\;z \leq -7.3 \cdot 10^{+202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+155}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+64}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-89}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-114}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 8
Error26.7
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ t_2 := -4.5 \cdot \frac{t \cdot z}{a}\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+155}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.25 \cdot 10^{+64}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-114}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 9
Error26.8
Cost1240
\[\begin{array}{l} t_1 := 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+202}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{+155}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{+65}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-89}:\\ \;\;\;\;\frac{-4.5}{\frac{a}{z \cdot t}}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-114}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 10
Error26.9
Cost1240
\[\begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+202}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+155}:\\ \;\;\;\;\frac{0.5}{\frac{a}{y \cdot x}}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+66}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{+29}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-88}:\\ \;\;\;\;\frac{-4.5}{\frac{a}{z \cdot t}}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-115}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 11
Error26.9
Cost1240
\[\begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+202}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+155}:\\ \;\;\;\;0.5 \cdot \frac{\frac{y}{\frac{1}{x}}}{a}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+65}:\\ \;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+30}:\\ \;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-89}:\\ \;\;\;\;\frac{-4.5}{\frac{a}{z \cdot t}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-114}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 12
Error32.9
Cost580
\[\begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{-140}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 13
Error33.3
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-193}:\\ \;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\ \end{array} \]
Alternative 14
Error33.2
Cost448
\[-4.5 \cdot \left(t \cdot \frac{z}{a}\right) \]

Error

Reproduce?

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