Average Error: 7.6 → 2.1
Time: 3.9s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \le 3.72607650680194631 \cdot 10^{192}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sqrt{1}}{y - z}}{\frac{t - z}{x}}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;x \le 3.72607650680194631 \cdot 10^{192}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return (x / ((y - z) * (t - z)));
}
double code(double x, double y, double z, double t) {
	double temp;
	if ((x <= 3.7260765068019463e+192)) {
		temp = ((x / (y - z)) / (t - z));
	} else {
		temp = ((sqrt(1.0) / (y - z)) / ((t - z) / x));
	}
	return temp;
}

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.6
Target8.4
Herbie2.1
\[\begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \lt 0.0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if x < 3.7260765068019463e+192

    1. Initial program 5.8

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

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

    if 3.7260765068019463e+192 < x

    1. Initial program 25.7

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}}\]
    4. Using strategy rm
    5. Applied clear-num4.3

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y - z}{x}}}}{t - z}\]
    6. Using strategy rm
    7. Applied div-inv4.4

      \[\leadsto \frac{\frac{1}{\color{blue}{\left(y - z\right) \cdot \frac{1}{x}}}}{t - z}\]
    8. Applied add-sqr-sqrt4.4

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{1}}{y - z} \cdot \frac{\sqrt{1}}{\frac{1}{x}}}}{t - z}\]
    10. Applied associate-/l*4.7

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{1}}{y - z}}{\frac{t - z}{\frac{\sqrt{1}}{\frac{1}{x}}}}}\]
    11. Simplified4.6

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

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

Reproduce

herbie shell --seed 2020058 
(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 (* (- y z) (- t z)))))

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