Average Error: 11.4 → 1.2
Time: 4.2s
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:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -4.699853111594 \cdot 10^{-316}:\\ \;\;\;\;\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 -\infty:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - 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)) (- INFINITY))
   (* (- y z) (/ x (- t z)))
   (if (<= (/ (* x (- y z)) (- t z)) -4.699853111594e-316)
     (/ (* x (- y z)) (- t z))
     (/ x (/ (- t z) (- y 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))) <= ((double) -(((double) INFINITY))))) {
		tmp = ((double) (((double) (y - z)) * (x / ((double) (t - z)))));
	} else {
		double tmp_1;
		if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= -4.699853111594e-316)) {
			tmp_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
		} else {
			tmp_1 = (x / (((double) (t - z)) / ((double) (y - 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.4
Herbie1.2
\[\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)) < -inf.0

    1. Initial program 64.0

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

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

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

    if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.699853112e-316

    1. Initial program 0.3

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

    if -4.699853112e-316 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 10.6

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - 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 -\infty:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -4.699853111594 \cdot 10^{-316}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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