Average Error: 11.4 → 2.0
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 -1.1628805360148156 \cdot 10^{+110}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.0528411766114093 \cdot 10^{+233}:\\ \;\;\;\;\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}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -1.1628805360148156 \cdot 10^{+110}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\

\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.0528411766114093 \cdot 10^{+233}:\\
\;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{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)) -1.1628805360148156e+110)
   (* (- y z) (/ x (- t z)))
   (if (<= (/ (* x (- y z)) (- t z)) 1.0528411766114093e+233)
     (* (* x (- y z)) (/ 1.0 (- 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 tmp;
	if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= -1.1628805360148156e+110)) {
		tmp = ((double) (((double) (y - z)) * (x / ((double) (t - z)))));
	} else {
		double tmp_1;
		if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 1.0528411766114093e+233)) {
			tmp_1 = ((double) (((double) (x * ((double) (y - z)))) * (1.0 / ((double) (t - z)))));
		} else {
			tmp_1 = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
		}
		tmp = tmp_1;
	}
	return tmp;
}

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.4
Target2.3
Herbie2.0
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -1.1628805360148156e110

    1. Initial program 34.8

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/_binary644.1

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

    if -1.1628805360148156e110 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.0528411766114093e233

    1. Initial program 1.5

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

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

    if 1.0528411766114093e233 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 51.6

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -1.1628805360148156 \cdot 10^{+110}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.0528411766114093 \cdot 10^{+233}:\\ \;\;\;\;\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 2020210 
(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)))