Average Error: 12.0 → 1.2
Time: 3.4s
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 5.926124174923842 \cdot 10^{-301}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.1377918219095245 \cdot 10^{+256}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - 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}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 5.926124174923842 \cdot 10^{-301}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.1377918219095245 \cdot 10^{+256}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - 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 (<= (/ (* x (- y z)) (- t z)) 5.926124174923842e-301)
   (/ x (/ (- t z) (- y z)))
   (if (<= (/ (* x (- y z)) (- t z)) 2.1377918219095245e+256)
     (/ (* x (- y z)) (- t z))
     (* x (/ (- y z) (- t z))))))
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))) <= 5.926124174923842e-301)) {
		VAR = (x / (((double) (t - z)) / ((double) (y - z))));
	} else {
		double VAR_1;
		if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 2.1377918219095245e+256)) {
			VAR_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
		} else {
			VAR_1 = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
		}
		VAR = VAR_1;
	}
	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
Target1.9
Herbie1.2
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < 5.9261241749238418e-301

    1. Initial program 11.6

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

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

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

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

    if 5.9261241749238418e-301 < (/ (* x (- y z)) (- t z)) < 2.1377918219095245e256

    1. Initial program 0.3

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

    if 2.1377918219095245e256 < (/ (* x (- y z)) (- t z))

    1. Initial program 56.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 5.926124174923842 \cdot 10^{-301}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.1377918219095245 \cdot 10^{+256}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array}\]

Reproduce

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