Average Error: 7.6 → 1.8
Time: 5.7s
Precision: binary64
\[\frac{x \cdot y - z \cdot t}{a}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\ \;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{a} - z \cdot \frac{t}{a}\\ \mathbf{elif}\;x \cdot y - z \cdot t \leq 6.724941789042702 \cdot 10^{+303}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{t}{\sqrt[3]{a}}\\ \end{array}\]
\frac{x \cdot y - z \cdot t}{a}
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\
\;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{a} - z \cdot \frac{t}{a}\\

\mathbf{elif}\;x \cdot y - z \cdot t \leq 6.724941789042702 \cdot 10^{+303}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{t}{\sqrt[3]{a}}\\

\end{array}
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
(FPCore (x y z t a)
 :precision binary64
 (if (<= (- (* x y) (* z t)) (- INFINITY))
   (- (* (* x (* (cbrt y) (cbrt y))) (/ (cbrt y) a)) (* z (/ t a)))
   (if (<= (- (* x y) (* z t)) 6.724941789042702e+303)
     (/ (- (* x y) (* z t)) a)
     (- (* x (/ y a)) (* (/ z (* (cbrt a) (cbrt a))) (/ t (cbrt a)))))))
double code(double x, double y, double z, double t, double a) {
	return (((double) (((double) (x * y)) - ((double) (z * t)))) / a);
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((((double) (((double) (x * y)) - ((double) (z * t)))) <= ((double) -(((double) INFINITY))))) {
		tmp = ((double) (((double) (((double) (x * ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * (((double) cbrt(y)) / a))) - ((double) (z * (t / a)))));
	} else {
		double tmp_1;
		if ((((double) (((double) (x * y)) - ((double) (z * t)))) <= 6.724941789042702e+303)) {
			tmp_1 = (((double) (((double) (x * y)) - ((double) (z * t)))) / a);
		} else {
			tmp_1 = ((double) (((double) (x * (y / a))) - ((double) ((z / ((double) (((double) cbrt(a)) * ((double) cbrt(a))))) * (t / ((double) cbrt(a)))))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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.6
Target6.2
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\ \;\;\;\;\frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{elif}\;z < 6.309831121978371 \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 3 regimes
  2. if (- (* x y) (* z t)) < -inf.0

    1. Initial program Error: 64.0 bits

      \[\frac{x \cdot y - z \cdot t}{a}\]
    2. Using strategy rm
    3. Applied div-subError: 64.0 bits

      \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}}\]
    4. SimplifiedError: 32.3 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{a}} - \frac{z \cdot t}{a}\]
    5. SimplifiedError: 0.2 bits

      \[\leadsto x \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{t}{a}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identityError: 0.2 bits

      \[\leadsto x \cdot \frac{y}{\color{blue}{1 \cdot a}} - z \cdot \frac{t}{a}\]
    8. Applied add-cube-cbrtError: 0.8 bits

      \[\leadsto x \cdot \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{1 \cdot a} - z \cdot \frac{t}{a}\]
    9. Applied times-fracError: 0.8 bits

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

      \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1}\right) \cdot \frac{\sqrt[3]{y}}{a}} - z \cdot \frac{t}{a}\]
    11. SimplifiedError: 18.8 bits

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

    if -inf.0 < (- (* x y) (* z t)) < 6.7249417890427016e303

    1. Initial program Error: 0.9 bits

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

    if 6.7249417890427016e303 < (- (* x y) (* z t))

    1. Initial program Error: 62.1 bits

      \[\frac{x \cdot y - z \cdot t}{a}\]
    2. Using strategy rm
    3. Applied div-subError: 62.1 bits

      \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}}\]
    4. SimplifiedError: 33.4 bits

      \[\leadsto \color{blue}{x \cdot \frac{y}{a}} - \frac{z \cdot t}{a}\]
    5. SimplifiedError: 0.3 bits

      \[\leadsto x \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{t}{a}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrtError: 0.8 bits

      \[\leadsto x \cdot \frac{y}{a} - z \cdot \frac{t}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
    8. Applied *-un-lft-identityError: 0.8 bits

      \[\leadsto x \cdot \frac{y}{a} - z \cdot \frac{\color{blue}{1 \cdot t}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    9. Applied times-fracError: 0.8 bits

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

      \[\leadsto x \cdot \frac{y}{a} - \color{blue}{\left(z \cdot \frac{1}{\sqrt[3]{a} \cdot \sqrt[3]{a}}\right) \cdot \frac{t}{\sqrt[3]{a}}}\]
    11. SimplifiedError: 0.8 bits

      \[\leadsto x \cdot \frac{y}{a} - \color{blue}{\frac{z}{\sqrt[3]{a} \cdot \sqrt[3]{a}}} \cdot \frac{t}{\sqrt[3]{a}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplificationError: 1.8 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\ \;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{a} - z \cdot \frac{t}{a}\\ \mathbf{elif}\;x \cdot y - z \cdot t \leq 6.724941789042702 \cdot 10^{+303}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{t}{\sqrt[3]{a}}\\ \end{array}\]

Reproduce

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