\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\begin{array}{l}
\mathbf{if}\;x \le 7.80787067859947528468579780877559401605 \cdot 10^{151}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}double f(double x, double y, double z, double t) {
double r352822 = x;
double r352823 = y;
double r352824 = z;
double r352825 = r352823 - r352824;
double r352826 = t;
double r352827 = r352826 - r352824;
double r352828 = r352825 * r352827;
double r352829 = r352822 / r352828;
return r352829;
}
double f(double x, double y, double z, double t) {
double r352830 = x;
double r352831 = 7.807870678599475e+151;
bool r352832 = r352830 <= r352831;
double r352833 = 1.0;
double r352834 = y;
double r352835 = z;
double r352836 = r352834 - r352835;
double r352837 = r352833 / r352836;
double r352838 = t;
double r352839 = r352838 - r352835;
double r352840 = r352830 / r352839;
double r352841 = r352837 * r352840;
double r352842 = r352830 / r352836;
double r352843 = r352842 / r352839;
double r352844 = r352832 ? r352841 : r352843;
return r352844;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.2 |
|---|---|
| Target | 8.0 |
| Herbie | 2.2 |
if x < 7.807870678599475e+151Initial program 5.6
rmApplied *-un-lft-identity5.6
Applied times-frac1.8
if 7.807870678599475e+151 < x Initial program 20.9
rmApplied associate-/r*4.9
Final simplification2.2
herbie shell --seed 2019362 +o rules:numerics
(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))))