Average Error: 0.5 → 1.0
Time: 13.1s
Precision: binary64
\[[z, t] = \mathsf{sort}([z, t]) \\]
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
\[1 - \frac{1}{\left(y - z\right) \cdot \left(\frac{1}{x} \cdot \left(y - t\right)\right)} \]
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
1 - \frac{1}{\left(y - z\right) \cdot \left(\frac{1}{x} \cdot \left(y - t\right)\right)}
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
(FPCore (x y z t)
 :precision binary64
 (- 1.0 (/ 1.0 (* (- y z) (* (/ 1.0 x) (- y t))))))
double code(double x, double y, double z, double t) {
	return 1.0 - (x / ((y - z) * (y - t)));
}
double code(double x, double y, double z, double t) {
	return 1.0 - (1.0 / ((y - z) * ((1.0 / x) * (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 0.5

    \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)} \]
  2. Applied clear-num_binary640.6

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

    \[\leadsto 1 - \frac{1}{\color{blue}{\frac{y - z}{\frac{x}{y - t}}}} \]
  4. Applied div-inv_binary641.1

    \[\leadsto 1 - \frac{1}{\color{blue}{\left(y - z\right) \cdot \frac{1}{\frac{x}{y - t}}}} \]
  5. Simplified1.0

    \[\leadsto 1 - \frac{1}{\left(y - z\right) \cdot \color{blue}{\left(\frac{1}{x} \cdot \left(y - t\right)\right)}} \]
  6. Final simplification1.0

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

Reproduce

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