Average Error: 7.4 → 0.7
Time: 3.9s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((((double) (((double) (y - z)) * ((double) (t - z)))) <= -inf.0) || !(((double) (((double) (y - z)) * ((double) (t - z)))) <= 2.2969001632558844e+241))) {
		VAR = ((double) (((double) (x / ((double) (y - z)))) / ((double) (t - z))));
	} else {
		VAR = ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.4
Target8.3
Herbie0.7
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (* (- y z) (- t z)) < -inf.0 or 2.29690016325588437e241 < (* (- y z) (- t z))

    1. Initial program 14.5

      \[\]
    2. Using strategy rm
    3. Applied associate-/r*0.1

      \[\leadsto \]

    if -inf.0 < (* (- y z) (- t z)) < 2.29690016325588437e241

    1. Initial program 1.2

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :herbie-target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

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