Average Error: 7.9 → 0.8
Time: 14.9s
Precision: 64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) = -\infty \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 1.632524052029920003545216193970885421399 \cdot 10^{136}\right):\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) = -\infty \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 1.632524052029920003545216193970885421399 \cdot 10^{136}\right):\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r600327 = x;
        double r600328 = y;
        double r600329 = z;
        double r600330 = r600328 - r600329;
        double r600331 = t;
        double r600332 = r600331 - r600329;
        double r600333 = r600330 * r600332;
        double r600334 = r600327 / r600333;
        return r600334;
}

double f(double x, double y, double z, double t) {
        double r600335 = y;
        double r600336 = z;
        double r600337 = r600335 - r600336;
        double r600338 = t;
        double r600339 = r600338 - r600336;
        double r600340 = r600337 * r600339;
        double r600341 = -inf.0;
        bool r600342 = r600340 <= r600341;
        double r600343 = 1.63252405202992e+136;
        bool r600344 = r600340 <= r600343;
        double r600345 = !r600344;
        bool r600346 = r600342 || r600345;
        double r600347 = x;
        double r600348 = r600347 / r600339;
        double r600349 = r600348 / r600337;
        double r600350 = r600347 / r600340;
        double r600351 = r600346 ? r600349 : r600350;
        return r600351;
}

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.6
Herbie0.8
\[\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 (* (- y z) (- t z)) < -inf.0 or 1.63252405202992e+136 < (* (- y z) (- t z))

    1. Initial program 12.9

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt13.1

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}}\]
    5. Using strategy rm
    6. Applied associate-*l/0.7

      \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{t - z}}{y - z}}\]
    7. Simplified0.3

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

    if -inf.0 < (* (- y z) (- t z)) < 1.63252405202992e+136

    1. Initial program 1.4

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) = -\infty \lor \neg \left(\left(y - z\right) \cdot \left(t - z\right) \le 1.632524052029920003545216193970885421399 \cdot 10^{136}\right):\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array}\]

Reproduce

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