Average Error: 7.3 → 1.0
Time: 3.7s
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)))) <= -7.60800479161067e+255)) {
		VAR = ((double) (1.0 / ((double) (((double) (t - z)) * ((double) (((double) (y - z)) / x))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 2.0116549643711714e+161)) {
			VAR_1 = ((double) (x / ((double) (((double) (y - z)) * ((double) (t - z))))));
		} else {
			VAR_1 = ((double) (((double) (x * ((double) (1.0 / ((double) (t - z)))))) / ((double) (y - z))));
		}
		VAR = VAR_1;
	}
	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.3
Target8.4
Herbie1.0
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (* (- y z) (- t z)) < -7.6080047916106696e255

    1. Initial program 15.5

      \[\]
    2. Using strategy rm
    3. Applied clear-num15.6

      \[\leadsto \]
    4. Simplified0.6

      \[\leadsto \]

    if -7.6080047916106696e255 < (* (- y z) (- t z)) < 2.01165496437117143e161

    1. Initial program 1.6

      \[\]

    if 2.01165496437117143e161 < (* (- y z) (- t z))

    1. Initial program 10.6

      \[\]
    2. Using strategy rm
    3. Applied *-un-lft-identity10.6

      \[\leadsto \]
    4. Applied times-frac0.6

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-*l/0.5

      \[\leadsto \]
    7. Simplified0.5

      \[\leadsto \]
    8. Using strategy rm
    9. Applied div-inv0.6

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \]

Reproduce

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