Average Error: 7.6 → 1.1
Time: 6.6s
Precision: binary64
\[[y, t]=\mathsf{sort}([y, t])\]
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
\[\begin{array}{l} t_1 := \sqrt[3]{y - z}\\ \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{t_1 \cdot t_1} \cdot \frac{\frac{\sqrt[3]{x}}{t_1}}{t - z} \end{array} \]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
t_1 := \sqrt[3]{y - z}\\
\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{t_1 \cdot t_1} \cdot \frac{\frac{\sqrt[3]{x}}{t_1}}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (cbrt (- y z))))
   (* (/ (* (cbrt x) (cbrt x)) (* t_1 t_1)) (/ (/ (cbrt x) t_1) (- t z)))))
double code(double x, double y, double z, double t) {
	return x / ((y - z) * (t - z));
}
double code(double x, double y, double z, double t) {
	double t_1 = cbrt(y - z);
	return ((cbrt(x) * cbrt(x)) / (t_1 * t_1)) * ((cbrt(x) / t_1) / (t - z));
}

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.2
Herbie1.1
\[\begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} < 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. Applied associate-/r*_binary641.9

    \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
  3. Applied *-un-lft-identity_binary641.9

    \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{1 \cdot \left(t - z\right)}} \]
  4. Applied add-cube-cbrt_binary642.5

    \[\leadsto \frac{\frac{x}{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}}{1 \cdot \left(t - z\right)} \]
  5. Applied add-cube-cbrt_binary642.7

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}}{1} \cdot \frac{\frac{\sqrt[3]{x}}{\sqrt[3]{y - z}}}{t - z}} \]
  8. Simplified1.1

    \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}} \cdot \frac{\frac{\sqrt[3]{x}}{\sqrt[3]{y - z}}}{t - z} \]
  9. Final simplification1.1

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

Reproduce

herbie shell --seed 2021313 
(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.0 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))