Average Error: 11.2 → 1.9
Time: 4.3s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[\begin{array}{l} \mathbf{if}\;z \leq -8.064804884425737 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \leq 2.295152313413225 \cdot 10^{-182}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{t - z} \cdot \frac{\sqrt[3]{x}}{\frac{1}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array} \]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \leq -8.064804884425737 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{elif}\;z \leq 2.295152313413225 \cdot 10^{-182}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{t - z} \cdot \frac{\sqrt[3]{x}}{\frac{1}{y - z}}\\

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


\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
 :precision binary64
 (if (<= z -8.064804884425737e-131)
   (/ x (/ (- t z) (- y z)))
   (if (<= z 2.295152313413225e-182)
     (* (/ (* (cbrt x) (cbrt x)) (- t z)) (/ (cbrt x) (/ 1.0 (- y z))))
     (* x (/ (- y z) (- 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 (z <= -8.064804884425737e-131) {
		tmp = x / ((t - z) / (y - z));
	} else if (z <= 2.295152313413225e-182) {
		tmp = ((cbrt(x) * cbrt(x)) / (t - z)) * (cbrt(x) / (1.0 / (y - z)));
	} else {
		tmp = x * ((y - z) / (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

Original11.2
Target2.4
Herbie1.9
\[\frac{x}{\frac{t - z}{y - z}} \]

Derivation

  1. Split input into 3 regimes
  2. if z < -8.06480488442573712e-131

    1. Initial program 13.6

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied associate-/l*_binary640.8

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

    if -8.06480488442573712e-131 < z < 2.295152313413225e-182

    1. Initial program 5.7

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied associate-/l*_binary646.6

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    3. Applied div-inv_binary646.7

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

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

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

    if 2.295152313413225e-182 < z

    1. Initial program 12.1

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied *-un-lft-identity_binary6412.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.064804884425737 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \leq 2.295152313413225 \cdot 10^{-182}:\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{t - z} \cdot \frac{\sqrt[3]{x}}{\frac{1}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array} \]

Reproduce

herbie shell --seed 2022125 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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