Average Error: 7.9 → 2.0
Time: 11.9s
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 r602846 = x;
        double r602847 = y;
        double r602848 = z;
        double r602849 = r602847 - r602848;
        double r602850 = t;
        double r602851 = r602850 - r602848;
        double r602852 = r602849 * r602851;
        double r602853 = r602846 / r602852;
        return r602853;
}

double f(double x, double y, double z, double t) {
        double r602854 = x;
        double r602855 = t;
        double r602856 = z;
        double r602857 = r602855 - r602856;
        double r602858 = r602854 / r602857;
        double r602859 = y;
        double r602860 = r602859 - r602856;
        double r602861 = r602858 / r602860;
        return r602861;
}

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.9
Target8.5
Herbie2.0
\[\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.9

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

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

    \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity2.0

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \left(y - z\right)}} \cdot \frac{x}{t - z}\]
  7. Applied *-un-lft-identity2.0

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

    \[\leadsto \color{blue}{\left(\frac{1}{1} \cdot \frac{1}{y - z}\right)} \cdot \frac{x}{t - z}\]
  9. Applied associate-*l*2.0

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

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

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

Reproduce

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