Average Error: 0.6 → 1.1
Time: 3.8s
Precision: binary64
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\]
\[1 + \frac{-1}{\frac{y - z}{x} \cdot \left(y - t\right)}\]
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
1 + \frac{-1}{\frac{y - z}{x} \cdot \left(y - t\right)}
double code(double x, double y, double z, double t) {
	return ((double) (1.0 - (x / ((double) (((double) (y - z)) * ((double) (y - t)))))));
}
double code(double x, double y, double z, double t) {
	return ((double) (1.0 + (-1.0 / ((double) ((((double) (y - z)) / x) * ((double) (y - t)))))));
}

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

Derivation

  1. Initial program Error: 0.6 bits

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\]
  2. Using strategy rm
  3. Applied clear-numError: 0.6 bits

    \[\leadsto 1 - \color{blue}{\frac{1}{\frac{\left(y - z\right) \cdot \left(y - t\right)}{x}}}\]
  4. SimplifiedError: 1.1 bits

    \[\leadsto 1 - \frac{1}{\color{blue}{\frac{y - z}{x} \cdot \left(y - t\right)}}\]
  5. Final simplificationError: 1.1 bits

    \[\leadsto 1 + \frac{-1}{\frac{y - z}{x} \cdot \left(y - t\right)}\]

Reproduce

herbie shell --seed 2020200 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
  :precision binary64
  (- 1.0 (/ x (* (- y z) (- y t)))))