Average Error: 11.9 → 0.5
Time: 3.5s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq -1.5716759441550515 \cdot 10^{-281} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 0\right) \land \frac{x \cdot \left(y - z\right)}{t - z} \leq 9.772596268328805 \cdot 10^{+221}\right):\\ \;\;\;\;\frac{x}{\frac{t - 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}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq -1.5716759441550515 \cdot 10^{-281} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 0\right) \land \frac{x \cdot \left(y - z\right)}{t - z} \leq 9.772596268328805 \cdot 10^{+221}\right):\\
\;\;\;\;\frac{x}{\frac{t - 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) (x * ((double) (y - z)))) / ((double) (t - z)));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= ((double) -(((double) INFINITY)))) || !(((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= -1.5716759441550515e-281) || (!((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 0.0) && ((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 9.772596268328805e+221))))) {
		VAR = (x / (((double) (t - z)) / ((double) (y - z))));
	} else {
		VAR = (((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.3
Herbie0.5
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* x (- y z)) (- t z)) < -inf.0 or -1.5716759441550515e-281 < (/ (* x (- y z)) (- t z)) < 0.0 or 9.772596268328805e221 < (/ (* x (- y z)) (- t z))

    1. Initial program 38.6

      \[\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-num0.9

      \[\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}}}\]

    if -inf.0 < (/ (* x (- y z)) (- t z)) < -1.5716759441550515e-281 or 0.0 < (/ (* x (- y z)) (- t z)) < 9.772596268328805e221

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq -1.5716759441550515 \cdot 10^{-281} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 0\right) \land \frac{x \cdot \left(y - z\right)}{t - z} \leq 9.772596268328805 \cdot 10^{+221}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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