Average Error: 8.0 → 2.2
Time: 4.0s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\frac{\frac{x}{t - z}}{y - z} \cdot \sqrt{1}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\frac{\frac{x}{t - z}}{y - z} \cdot \sqrt{1}
double f(double x, double y, double z, double t) {
        double r723649 = x;
        double r723650 = y;
        double r723651 = z;
        double r723652 = r723650 - r723651;
        double r723653 = t;
        double r723654 = r723653 - r723651;
        double r723655 = r723652 * r723654;
        double r723656 = r723649 / r723655;
        return r723656;
}

double f(double x, double y, double z, double t) {
        double r723657 = x;
        double r723658 = t;
        double r723659 = z;
        double r723660 = r723658 - r723659;
        double r723661 = r723657 / r723660;
        double r723662 = y;
        double r723663 = r723662 - r723659;
        double r723664 = r723661 / r723663;
        double r723665 = 1.0;
        double r723666 = sqrt(r723665);
        double r723667 = r723664 * r723666;
        return r723667;
}

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

Original8.0
Target8.7
Herbie2.2
\[\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 8.0

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

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

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

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

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

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

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

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

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

Reproduce

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