Average Error: 11.9 → 1.3
Time: 4.0s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -5.75209740167366593 \cdot 10^{293} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 6.783031243585547 \cdot 10^{289}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -5.75209740167366593 \cdot 10^{293} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 6.783031243585547 \cdot 10^{289}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - 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 (((((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z)))) <= -5.752097401673666e+293) || !(((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z)))) <= 6.783031243585547e+289))) {
		VAR = ((double) (x * ((double) (((double) (y - z)) / ((double) (t - z))))));
	} else {
		VAR = ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - 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.9
Target2.1
Herbie1.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* x (- y z)) (- t z)) < -5.752097401673666e+293 or 6.783031243585547e+289 < (/ (* x (- y z)) (- t z))

    1. Initial program 61.4

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity61.4

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

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]
    5. Simplified0.6

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

    if -5.752097401673666e+293 < (/ (* x (- y z)) (- t z)) < 6.783031243585547e+289

    1. Initial program 1.5

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -5.75209740167366593 \cdot 10^{293} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 6.783031243585547 \cdot 10^{289}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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