Average Error: 12.0 → 2.3
Time: 4.1s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -9.4761928936906738 \cdot 10^{-199} \lor \neg \left(z \le 2.3289974463294087 \cdot 10^{-48}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - 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}\;z \le -9.4761928936906738 \cdot 10^{-199} \lor \neg \left(z \le 2.3289974463294087 \cdot 10^{-48}\right):\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - 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 (((z <= -9.476192893690674e-199) || !(z <= 2.3289974463294087e-48))) {
		VAR = ((double) (x / ((double) (((double) (t / ((double) (y - z)))) - ((double) (z / ((double) (y - 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

Original12.0
Target2.2
Herbie2.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -9.4761928936906738e-199 or 2.3289974463294087e-48 < z

    1. Initial program 14.4

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
    3. Using strategy rm
    4. Applied clear-num1.0

      \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}}\]
    5. Using strategy rm
    6. Applied un-div-inv0.8

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    7. Using strategy rm
    8. Applied div-sub0.8

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

    if -9.4761928936906738e-199 < z < 2.3289974463294087e-48

    1. Initial program 6.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -9.4761928936906738 \cdot 10^{-199} \lor \neg \left(z \le 2.3289974463294087 \cdot 10^{-48}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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