Average Error: 12.0 → 1.3
Time: 3.9s
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 1.503045921817015 \cdot 10^{-229}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503823389807409 \cdot 10^{+304}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - 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 1.503045921817015 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503823389807409 \cdot 10^{+304}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - 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))) <= 1.503045921817015e-229)) {
		VAR = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
	} else {
		double VAR_1;
		if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 1.503823389807409e+304)) {
			VAR_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
		} else {
			VAR_1 = (x / (((double) (t - z)) / ((double) (y - 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
Target2.1
Herbie1.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

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

    1. Initial program 10.6

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

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

    if 1.5030459218170149e-229 < (/ (* x (- y z)) (- t z)) < 1.5038233898074091e304

    1. Initial program 0.3

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

    if 1.5038233898074091e304 < (/ (* x (- y z)) (- t z))

    1. Initial program 63.7

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503045921817015 \cdot 10^{-229}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503823389807409 \cdot 10^{+304}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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