Average Error: 11.4 → 2.2
Time: 5.4s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.04150968945594362 \cdot 10^{-92} \lor \neg \left(z \le 3.5380098935821607 \cdot 10^{-206}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -1.04150968945594362 \cdot 10^{-92} \lor \neg \left(z \le 3.5380098935821607 \cdot 10^{-206}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((z <= -1.0415096894559436e-92) || !(z <= 3.5380098935821607e-206))) {
		VAR = ((double) (x / ((double) (((double) (t - z)) / ((double) (y - z))))));
	} else {
		VAR = ((double) (((double) (x / ((double) (t - z)))) / ((double) (1.0 / ((double) (y - z))))));
	}
	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

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

Derivation

  1. Split input into 2 regimes
  2. if z < -1.04150968945594362e-92 or 3.5380098935821607e-206 < z

    1. Initial program 13.1

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*1.1

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

    if -1.04150968945594362e-92 < z < 3.5380098935821607e-206

    1. Initial program 5.8

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*6.0

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied div-inv6.1

      \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot \frac{1}{y - z}}}\]
    6. Applied associate-/r*5.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.04150968945594362 \cdot 10^{-92} \lor \neg \left(z \le 3.5380098935821607 \cdot 10^{-206}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \end{array}\]

Reproduce

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