Average Error: 11.5 → 1.3
Time: 4.6s
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 \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.0004966526134228 \cdot 10^{+207}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{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 \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.0004966526134228 \cdot 10^{+207}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\

\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ (* x (- y z)) (- t z)) (- INFINITY))
         (not (<= (/ (* x (- y z)) (- t z)) 2.0004966526134228e+207)))
   (/ x (/ (- t z) (- y z)))
   (/ (* x (- y z)) (- 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)) || !(((x * (y - z)) / (t - z)) <= 2.0004966526134228e+207)) {
		tmp = x / ((t - z) / (y - z));
	} else {
		tmp = (x * (y - z)) / (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.5
Target2.4
Herbie1.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or 2.0004966526134228e207 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 54.7

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

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

    if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2.0004966526134228e207

    1. Initial program 1.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.0004966526134228 \cdot 10^{+207}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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