Average Error: 11.7 → 2.5
Time: 5.0s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.58437304965556891 \cdot 10^{35}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \le 2.2543854873075763 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{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}\;z \le -1.58437304965556891 \cdot 10^{35}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{elif}\;z \le 2.2543854873075763 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{t - z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{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 <= -1.5843730496555689e+35)) {
		VAR = ((double) (x / ((double) (((double) (t - z)) / ((double) (y - z))))));
	} else {
		double VAR_1;
		if ((z <= 2.2543854873075763e-161)) {
			VAR_1 = ((double) (((double) (x * ((double) (y - z)))) * ((double) (1.0 / ((double) (t - z))))));
		} else {
			VAR_1 = ((double) (x * ((double) (((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

Original11.7
Target2.2
Herbie2.5
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.58437304965556891e35

    1. Initial program 19.6

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied associate-/l*0.1

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

    if -1.58437304965556891e35 < z < 2.2543854873075763e-161

    1. Initial program 5.2

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied div-inv5.3

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

    if 2.2543854873075763e-161 < z

    1. Initial program 13.3

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.58437304965556891 \cdot 10^{35}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \le 2.2543854873075763 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array}\]

Reproduce

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