?

Average Accuracy: 88.5% → 98.8%
Time: 19.9s
Precision: binary64
Cost: 2248

?

\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2} \]
\[\begin{array}{l} t_1 := z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\ t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{+223}:\\ \;\;\;\;t_1 + \frac{y \cdot 0.5}{\frac{a}{x}}\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+289}:\\ \;\;\;\;\frac{t_2}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \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 (* z (* t (/ -4.5 a)))) (t_2 (+ (* x y) (* t (* z -9.0)))))
   (if (<= t_2 -1e+223)
     (+ t_1 (/ (* y 0.5) (/ a x)))
     (if (<= t_2 4e+289) (/ t_2 (* a 2.0)) (+ t_1 (* (* y 0.5) (/ x a)))))))
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 = z * (t * (-4.5 / a));
	double t_2 = (x * y) + (t * (z * -9.0));
	double tmp;
	if (t_2 <= -1e+223) {
		tmp = t_1 + ((y * 0.5) / (a / x));
	} else if (t_2 <= 4e+289) {
		tmp = t_2 / (a * 2.0);
	} else {
		tmp = t_1 + ((y * 0.5) * (x / a));
	}
	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 = z * (t * ((-4.5d0) / a))
    t_2 = (x * y) + (t * (z * (-9.0d0)))
    if (t_2 <= (-1d+223)) then
        tmp = t_1 + ((y * 0.5d0) / (a / x))
    else if (t_2 <= 4d+289) then
        tmp = t_2 / (a * 2.0d0)
    else
        tmp = t_1 + ((y * 0.5d0) * (x / a))
    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 = z * (t * (-4.5 / a));
	double t_2 = (x * y) + (t * (z * -9.0));
	double tmp;
	if (t_2 <= -1e+223) {
		tmp = t_1 + ((y * 0.5) / (a / x));
	} else if (t_2 <= 4e+289) {
		tmp = t_2 / (a * 2.0);
	} else {
		tmp = t_1 + ((y * 0.5) * (x / a));
	}
	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 = z * (t * (-4.5 / a))
	t_2 = (x * y) + (t * (z * -9.0))
	tmp = 0
	if t_2 <= -1e+223:
		tmp = t_1 + ((y * 0.5) / (a / x))
	elif t_2 <= 4e+289:
		tmp = t_2 / (a * 2.0)
	else:
		tmp = t_1 + ((y * 0.5) * (x / a))
	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(z * Float64(t * Float64(-4.5 / a)))
	t_2 = Float64(Float64(x * y) + Float64(t * Float64(z * -9.0)))
	tmp = 0.0
	if (t_2 <= -1e+223)
		tmp = Float64(t_1 + Float64(Float64(y * 0.5) / Float64(a / x)));
	elseif (t_2 <= 4e+289)
		tmp = Float64(t_2 / Float64(a * 2.0));
	else
		tmp = Float64(t_1 + Float64(Float64(y * 0.5) * Float64(x / a)));
	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 = z * (t * (-4.5 / a));
	t_2 = (x * y) + (t * (z * -9.0));
	tmp = 0.0;
	if (t_2 <= -1e+223)
		tmp = t_1 + ((y * 0.5) / (a / x));
	elseif (t_2 <= 4e+289)
		tmp = t_2 / (a * 2.0);
	else
		tmp = t_1 + ((y * 0.5) * (x / a));
	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[(z * N[(t * N[(-4.5 / a), $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, -1e+223], N[(t$95$1 + N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+289], N[(t$95$2 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(y * 0.5), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\begin{array}{l}
t_1 := z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\
t_2 := x \cdot y + t \cdot \left(z \cdot -9\right)\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+223}:\\
\;\;\;\;t_1 + \frac{y \cdot 0.5}{\frac{a}{x}}\\

\mathbf{elif}\;t_2 \leq 4 \cdot 10^{+289}:\\
\;\;\;\;\frac{t_2}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;t_1 + \left(y \cdot 0.5\right) \cdot \frac{x}{a}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original88.5%
Target91.4%
Herbie98.8%
\[\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 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -1.00000000000000005e223

    1. Initial program 48.6%

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

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

      [Start]48.6

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

      sub-neg [=>]48.6

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

      remove-double-neg [<=]48.6

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

      distribute-neg-in [<=]48.6

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

      +-commutative [<=]48.6

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

      sub-neg [<=]48.6

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

      neg-mul-1 [=>]48.6

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

      associate-/l* [=>]48.6

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

      associate-/r/ [=>]48.6

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

      sub-neg [=>]48.6

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

      +-commutative [=>]48.6

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

      neg-sub0 [=>]48.6

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

      associate-+l- [=>]48.6

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

      sub0-neg [=>]48.6

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

      distribute-rgt-neg-out [=>]48.6

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

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

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

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

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

      [Start]49.4

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

      expm1-log1p-u [=>]35.4

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

      expm1-udef [=>]32.1

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

      clear-num [=>]32.1

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

      un-div-inv [=>]32.1

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

      associate-/r/ [=>]32.1

      \[ \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{-4.5}{a} \cdot \left(t \cdot z\right)}\right)} - 1\right) + 0.5 \cdot \frac{y \cdot x}{a} \]
    5. Simplified72.8%

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

      [Start]32.1

      \[ \left(e^{\mathsf{log1p}\left(\frac{-4.5}{a} \cdot \left(t \cdot z\right)\right)} - 1\right) + 0.5 \cdot \frac{y \cdot x}{a} \]

      expm1-def [=>]35.4

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

      expm1-log1p [=>]49.4

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

      associate-*r* [=>]72.8

      \[ \color{blue}{\left(\frac{-4.5}{a} \cdot t\right) \cdot z} + 0.5 \cdot \frac{y \cdot x}{a} \]
    6. Applied egg-rr98.3%

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

      [Start]72.8

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

      *-commutative [=>]72.8

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

      associate-/l* [=>]98.3

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

      associate-*l/ [=>]98.3

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

    if -1.00000000000000005e223 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 4.0000000000000002e289

    1. Initial program 98.8%

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

    if 4.0000000000000002e289 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t))

    1. Initial program 14.2%

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

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

      [Start]14.2

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

      sub-neg [=>]14.2

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

      remove-double-neg [<=]14.2

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

      distribute-neg-in [<=]14.2

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

      +-commutative [<=]14.2

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

      sub-neg [<=]14.2

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

      neg-mul-1 [=>]14.2

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

      associate-/l* [=>]14.2

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

      associate-/r/ [=>]14.2

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

      sub-neg [=>]14.2

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

      +-commutative [=>]14.2

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

      neg-sub0 [=>]14.2

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

      associate-+l- [=>]14.2

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

      sub0-neg [=>]14.2

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

      distribute-rgt-neg-out [=>]14.2

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

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

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

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

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

      [Start]14.8

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

      expm1-log1p-u [=>]9.6

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

      expm1-udef [=>]9.3

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

      clear-num [=>]9.3

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

      un-div-inv [=>]9.3

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

      associate-/r/ [=>]9.3

      \[ \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{-4.5}{a} \cdot \left(t \cdot z\right)}\right)} - 1\right) + 0.5 \cdot \frac{y \cdot x}{a} \]
    5. Simplified50.6%

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

      [Start]9.3

      \[ \left(e^{\mathsf{log1p}\left(\frac{-4.5}{a} \cdot \left(t \cdot z\right)\right)} - 1\right) + 0.5 \cdot \frac{y \cdot x}{a} \]

      expm1-def [=>]9.6

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

      expm1-log1p [=>]14.8

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

      associate-*r* [=>]50.6

      \[ \color{blue}{\left(\frac{-4.5}{a} \cdot t\right) \cdot z} + 0.5 \cdot \frac{y \cdot x}{a} \]
    6. Applied egg-rr68.8%

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

      [Start]50.6

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

      expm1-log1p-u [=>]45.1

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

      expm1-udef [=>]45.1

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

      *-commutative [=>]45.1

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

      *-commutative [=>]45.1

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

      associate-/l* [=>]68.8

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

      associate-/r/ [=>]68.8

      \[ \left(\frac{-4.5}{a} \cdot t\right) \cdot z + \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\frac{x}{a} \cdot y\right)} \cdot 0.5\right)} - 1\right) \]
    7. Simplified99.3%

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

      [Start]68.8

      \[ \left(\frac{-4.5}{a} \cdot t\right) \cdot z + \left(e^{\mathsf{log1p}\left(\left(\frac{x}{a} \cdot y\right) \cdot 0.5\right)} - 1\right) \]

      expm1-def [=>]68.8

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

      expm1-log1p [=>]99.3

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

      associate-*l* [=>]99.3

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

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

Alternatives

Alternative 1
Accuracy98.8%
Cost2249
\[\begin{array}{l} t_1 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+223} \lor \neg \left(t_1 \leq 4 \cdot 10^{+289}\right):\\ \;\;\;\;z \cdot \left(t \cdot \frac{-4.5}{a}\right) + \left(y \cdot 0.5\right) \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{a \cdot 2}\\ \end{array} \]
Alternative 2
Accuracy92.6%
Cost2120
\[\begin{array}{l} t_1 := x \cdot y + t \cdot \left(z \cdot -9\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+288}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;\frac{t_1}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \end{array} \]
Alternative 3
Accuracy61.5%
Cost1240
\[\begin{array}{l} t_1 := \frac{0.5}{a} \cdot \left(x \cdot y\right)\\ t_2 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-25}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-54}:\\ \;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \end{array} \]
Alternative 4
Accuracy61.4%
Cost1240
\[\begin{array}{l} t_1 := \frac{0.5}{a} \cdot \left(x \cdot y\right)\\ t_2 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-26}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-54}:\\ \;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{\frac{a}{-4.5}}{t}}\\ \end{array} \]
Alternative 5
Accuracy61.4%
Cost1240
\[\begin{array}{l} t_1 := \frac{x \cdot y}{a \cdot 2}\\ t_2 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-25}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{\frac{a}{-4.5}}{t}}\\ \end{array} \]
Alternative 6
Accuracy61.4%
Cost1240
\[\begin{array}{l} t_1 := \frac{x \cdot y}{a \cdot 2}\\ t_2 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+32}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-25}:\\ \;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-56}:\\ \;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot -4.5}{\frac{a}{t}}\\ \end{array} \]
Alternative 7
Accuracy84.7%
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -5.1 \cdot 10^{+191}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+27}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(x \cdot y + \left(z \cdot t\right) \cdot -9\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \end{array} \]
Alternative 8
Accuracy84.8%
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+191}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+27}:\\ \;\;\;\;\frac{x \cdot y + \left(z \cdot t\right) \cdot -9}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \end{array} \]
Alternative 9
Accuracy60.4%
Cost976
\[\begin{array}{l} t_1 := 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+69}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-54}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 10
Accuracy60.3%
Cost976
\[\begin{array}{l} t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -2.9 \cdot 10^{+69}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-54}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-119}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 11
Accuracy60.4%
Cost976
\[\begin{array}{l} t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+69}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-56}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-114}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \end{array} \]
Alternative 12
Accuracy60.4%
Cost976
\[\begin{array}{l} t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{+69}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-115}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{t \cdot -4.5}{a}\\ \end{array} \]
Alternative 13
Accuracy50.2%
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-131}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+97}:\\ \;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \end{array} \]
Alternative 14
Accuracy48.4%
Cost580
\[\begin{array}{l} \mathbf{if}\;t \leq 4 \cdot 10^{+83}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\ \end{array} \]
Alternative 15
Accuracy48.5%
Cost580
\[\begin{array}{l} \mathbf{if}\;t \leq 1.25 \cdot 10^{+83}:\\ \;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\ \end{array} \]
Alternative 16
Accuracy48.7%
Cost448
\[-4.5 \cdot \left(z \cdot \frac{t}{a}\right) \]

Error

Reproduce?

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