Average Error: 7.5 → 0.9
Time: 3.5s
Precision: binary64
\[\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) \leq 0:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y - z}\right) \cdot \frac{\sqrt[3]{x}}{t - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq 2.931163622679604 \cdot 10^{+244}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \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) \leq 0:\\
\;\;\;\;\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y - z}\right) \cdot \frac{\sqrt[3]{x}}{t - z}\\

\mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq 2.931163622679604 \cdot 10^{+244}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\

\end{array}
double code(double x, double y, double z, double t) {
	return (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 0.0)) {
		VAR = ((double) (((double) (((double) cbrt(x)) * (((double) cbrt(x)) / ((double) (y - z))))) * (((double) cbrt(x)) / ((double) (t - z)))));
	} else {
		double VAR_1;
		if ((((double) (((double) (y - z)) * ((double) (t - z)))) <= 2.931163622679604e+244)) {
			VAR_1 = (x / ((double) (((double) (y - z)) * ((double) (t - z)))));
		} else {
			VAR_1 = ((x / ((double) (t - z))) / ((double) (y - z)));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.5
Target8.1
Herbie0.9
\[\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. Split input into 3 regimes
  2. if (* (- y z) (- t z)) < 0.0

    1. Initial program 7.9

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

      \[\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-frac2.2

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}}\]
    5. Simplified2.2

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

    if 0.0 < (* (- y z) (- t z)) < 2.93116362267960373e244

    1. Initial program 0.3

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]

    if 2.93116362267960373e244 < (* (- 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.0

      \[\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.4

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}}\]
    5. Simplified0.4

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y - z}\right)} \cdot \frac{\sqrt[3]{x}}{t - z}\]
    6. Using strategy rm
    7. Applied associate-*r/0.4

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z}} \cdot \frac{\sqrt[3]{x}}{t - z}\]
    8. Applied associate-*l/0.5

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

      \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \leq 0:\\ \;\;\;\;\left(\sqrt[3]{x} \cdot \frac{\sqrt[3]{x}}{y - z}\right) \cdot \frac{\sqrt[3]{x}}{t - z}\\ \mathbf{elif}\;\left(y - z\right) \cdot \left(t - z\right) \leq 2.931163622679604 \cdot 10^{+244}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \end{array}\]

Reproduce

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