Average Error: 0.7 → 0.6
Time: 3.7s
Precision: binary64
\[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\]
\[\begin{array}{l} \mathbf{if}\;t \le 2.72196741455087472 \cdot 10^{67}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{1}{y - z} \cdot \frac{x}{y - t}\\ \end{array}\]
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\begin{array}{l}
\mathbf{if}\;t \le 2.72196741455087472 \cdot 10^{67}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y - t}\\

\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{y - z} \cdot \frac{x}{y - t}\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (1.0 - ((double) (x / ((double) (((double) (y - z)) * ((double) (y - t))))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((t <= 2.721967414550875e+67)) {
		VAR = ((double) (1.0 - ((double) (((double) (x / ((double) (y - z)))) / ((double) (y - t))))));
	} else {
		VAR = ((double) (1.0 - ((double) (((double) (1.0 / ((double) (y - z)))) * ((double) (x / ((double) (y - t))))))));
	}
	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

Derivation

  1. Split input into 2 regimes
  2. if t < 2.72196741455087472e67

    1. Initial program 0.9

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\]
    2. Using strategy rm
    3. Applied associate-/r*0.7

      \[\leadsto 1 - \color{blue}{\frac{\frac{x}{y - z}}{y - t}}\]

    if 2.72196741455087472e67 < t

    1. Initial program 0.1

      \[1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.1

      \[\leadsto 1 - \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(y - t\right)}\]
    4. Applied times-frac0.0

      \[\leadsto 1 - \color{blue}{\frac{1}{y - z} \cdot \frac{x}{y - t}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le 2.72196741455087472 \cdot 10^{67}:\\ \;\;\;\;1 - \frac{\frac{x}{y - z}}{y - t}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{1}{y - z} \cdot \frac{x}{y - t}\\ \end{array}\]

Reproduce

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