Average Error: 7.6 → 2.1
Time: 18.0s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{t - z}}{y - z}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{t - z}}{y - z}
double f(double x, double y, double z, double t) {
        double r488341 = x;
        double r488342 = y;
        double r488343 = z;
        double r488344 = r488342 - r488343;
        double r488345 = t;
        double r488346 = r488345 - r488343;
        double r488347 = r488344 * r488346;
        double r488348 = r488341 / r488347;
        return r488348;
}

double f(double x, double y, double z, double t) {
        double r488349 = x;
        double r488350 = t;
        double r488351 = z;
        double r488352 = r488350 - r488351;
        double r488353 = r488349 / r488352;
        double r488354 = y;
        double r488355 = r488354 - r488351;
        double r488356 = r488353 / r488355;
        return r488356;
}

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. Initial program 7.6

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

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

    \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
  5. Using strategy rm
  6. Applied clear-num2.2

    \[\leadsto \frac{1}{y - z} \cdot \color{blue}{\frac{1}{\frac{t - z}{x}}}\]
  7. Using strategy rm
  8. Applied associate-*l/2.2

    \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{\frac{t - z}{x}}}{y - z}}\]
  9. Simplified2.1

    \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z}\]
  10. Final simplification2.1

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

Reproduce

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