Average Error: 11.4 → 1.2
Time: 5.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:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 8.33711053887 \cdot 10^{+298}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{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 -\infty:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{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)) (- INFINITY))
   (* x (/ (- y z) (- t z)))
   (if (<= (/ (* x (- y z)) (- t z)) 8.33711053887e+298)
     (/ (* x (- y z)) (- t z))
     (* (- y z) (/ x (- t z))))))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x * (y - z)) / (t - z)) <= -((double) INFINITY)) {
		tmp = x * ((y - z) / (t - z));
	} else if (((x * (y - z)) / (t - z)) <= 8.33711053887e+298) {
		tmp = (x * (y - z)) / (t - z);
	} else {
		tmp = (y - z) * (x / (t - z));
	}
	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.1
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 *-un-lft-identity_binary64_1849264.0

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

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

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

    if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 8.33711053886999971e298

    1. Initial program 1.3

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

    if 8.33711053886999971e298 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 62.3

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

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

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

Reproduce

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