Average Error: 7.5 → 6.4
Time: 5.8s
Precision: binary64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \le 2.15608682219969581 \cdot 10^{302}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot \left(y \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}} - \frac{t \cdot \left(z \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}}\right) \cdot \frac{1}{\sqrt[3]{a}}\\ \end{array}\]
\frac{x \cdot y - z \cdot t}{a}
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \le 2.15608682219969581 \cdot 10^{302}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{x \cdot \left(y \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}} - \frac{t \cdot \left(z \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}}\right) \cdot \frac{1}{\sqrt[3]{a}}\\

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (((double) (x * y)) - ((double) (z * t)))) <= 2.1560868221996958e+302)) {
		VAR = ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a));
	} else {
		VAR = ((double) (((double) (((double) (((double) (x * ((double) (y * ((double) exp(((double) (0.3333333333333333 * ((double) (((double) log(1.0)) + ((double) (2.0 * ((double) log(((double) (-1.0 / a)))))))))))))))) / ((double) pow(((double) cbrt(-1.0)), 2.0)))) - ((double) (((double) (t * ((double) (z * ((double) exp(((double) (0.3333333333333333 * ((double) (((double) log(1.0)) + ((double) (2.0 * ((double) log(((double) (-1.0 / a)))))))))))))))) / ((double) pow(((double) cbrt(-1.0)), 2.0)))))) * ((double) (1.0 / ((double) cbrt(a))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.5
Target5.8
Herbie6.4
\[\begin{array}{l} \mathbf{if}\;z \lt -2.46868496869954822 \cdot 10^{170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z \lt 6.30983112197837121 \cdot 10^{-71}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (- (* x y) (* z t)) < 2.15608682219969581e302

    1. Initial program 4.2

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

    if 2.15608682219969581e302 < (- (* x y) (* z t))

    1. Initial program 62.1

      \[\frac{x \cdot y - z \cdot t}{a}\]
    2. Using strategy rm
    3. Applied div-inv62.1

      \[\leadsto \color{blue}{\left(x \cdot y - z \cdot t\right) \cdot \frac{1}{a}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt62.2

      \[\leadsto \left(x \cdot y - z \cdot t\right) \cdot \frac{1}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
    6. Applied *-un-lft-identity62.2

      \[\leadsto \left(x \cdot y - z \cdot t\right) \cdot \frac{\color{blue}{1 \cdot 1}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    7. Applied times-frac62.2

      \[\leadsto \left(x \cdot y - z \cdot t\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{1}{\sqrt[3]{a}}\right)}\]
    8. Applied associate-*r*62.2

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

      \[\leadsto \color{blue}{\frac{x \cdot y - z \cdot t}{\sqrt[3]{a} \cdot \sqrt[3]{a}}} \cdot \frac{1}{\sqrt[3]{a}}\]
    10. Taylor expanded around -inf 43.7

      \[\leadsto \color{blue}{\left(\frac{x \cdot \left(y \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}} - \frac{t \cdot \left(z \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}}\right)} \cdot \frac{1}{\sqrt[3]{a}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \le 2.15608682219969581 \cdot 10^{302}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x \cdot \left(y \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}} - \frac{t \cdot \left(z \cdot e^{\frac{1}{3} \cdot \left(\log 1 + 2 \cdot \log \left(\frac{-1}{a}\right)\right)}\right)}{{\left(\sqrt[3]{-1}\right)}^{2}}\right) \cdot \frac{1}{\sqrt[3]{a}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020147 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :herbie-target
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

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