Average Error: 7.4 → 0.9
Time: 5.1s
Precision: binary64
\[\]
\[\]
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.8999137816709986e+229) || !(((double) (((double) (x * y)) - ((double) (z * t)))) <= 7.587934256028063e+214))) {
		VAR = ((double) (((double) (x * ((double) (y / a)))) - ((double) (z * ((double) (t / a))))));
	} else {
		VAR = ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / 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.4
Target5.9
Herbie0.9
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (- (* x y) (* z t)) < -2.8999137816709986e229 or 7.5879342560280627e214 < (- (* x y) (* z t))

    1. Initial program 32.7

      \[\]
    2. Using strategy rm
    3. Applied div-sub32.7

      \[\leadsto \]
    4. Simplified17.2

      \[\leadsto \]
    5. Simplified1.0

      \[\leadsto \]

    if -2.8999137816709986e229 < (- (* x y) (* z t)) < 7.5879342560280627e214

    1. Initial program 0.9

      \[\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.9

    \[\leadsto \]

Reproduce

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