Average Error: 7.3 → 1.6
Time: 6.4s
Precision: binary64
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \leq -2.706556547970783 \cdot 10^{-173}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{elif}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \leq 8.33579817500726 \cdot 10^{-265}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}\\ \end{array}\]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\begin{array}{l}
\mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \leq -2.706556547970783 \cdot 10^{-173}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}\\

\end{array}
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ x (* (- y z) (- t z))) -2.706556547970783e-173)
   (/ x (* (- y z) (- t z)))
   (if (<= (/ x (* (- y z) (- t z))) 8.33579817500726e-265)
     (/ (/ x (- t z)) (- y z))
     (* (/ (* (cbrt x) (cbrt x)) (- y z)) (/ (cbrt x) (- 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 tmp;
	if ((x / ((y - z) * (t - z))) <= -2.706556547970783e-173) {
		tmp = x / ((y - z) * (t - z));
	} else if ((x / ((y - z) * (t - z))) <= 8.33579817500726e-265) {
		tmp = (x / (t - z)) / (y - z);
	} else {
		tmp = ((cbrt(x) * cbrt(x)) / (y - z)) * (cbrt(x) / (t - z));
	}
	return tmp;
}

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.3
Target8.2
Herbie1.6
\[\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 (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -2.7065565479707829e-173

    1. Initial program 1.8

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

    if -2.7065565479707829e-173 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < 8.3357981750072597e-265

    1. Initial program 11.3

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary64_2159611.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-frac_binary64_215670.9

      \[\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/_binary64_215041.5

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

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

    if 8.3357981750072597e-265 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 1.5

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y - z} \cdot \frac{\sqrt[3]{x}}{t - z}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.6

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

Reproduce

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