Average Error: 11.9 → 2.7
Time: 3.9s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -1.153141386606573 \cdot 10^{+56} \lor \neg \left(z \leq 4.4134199192979195 \cdot 10^{+34}\right):\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \leq -1.153141386606573 \cdot 10^{+56} \lor \neg \left(z \leq 4.4134199192979195 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.153141386606573e+56) (not (<= z 4.4134199192979195e+34)))
   (* x (- (/ y (- t z)) (/ 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 (((z <= -1.153141386606573e+56) || !(z <= 4.4134199192979195e+34))) {
		tmp = ((double) (x * ((double) ((y / ((double) (t - z))) - (z / ((double) (t - z)))))));
	} else {
		tmp = ((double) ((x / ((double) (t - z))) * ((double) (y - 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.9
Target2.2
Herbie2.7
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -1.1531413866065731e56 or 4.4134199192979195e34 < z

    1. Initial program Error: 19.3 bits

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. SimplifiedError: 0.1 bits

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
    3. Using strategy rm
    4. Applied div-subError: 0.1 bits

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

    if -1.1531413866065731e56 < z < 4.4134199192979195e34

    1. Initial program Error: 5.6 bits

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. SimplifiedError: 4.0 bits

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
    3. Using strategy rm
    4. Applied div-subError: 4.0 bits

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)}\]
    5. Using strategy rm
    6. Applied div-invError: 4.0 bits

      \[\leadsto x \cdot \left(\frac{y}{t - z} - \color{blue}{z \cdot \frac{1}{t - z}}\right)\]
    7. Applied div-invError: 4.1 bits

      \[\leadsto x \cdot \left(\color{blue}{y \cdot \frac{1}{t - z}} - z \cdot \frac{1}{t - z}\right)\]
    8. Applied distribute-rgt-out--Error: 4.1 bits

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{t - z} \cdot \left(y - z\right)\right)}\]
    9. Applied associate-*r*Error: 5.0 bits

      \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right) \cdot \left(y - z\right)}\]
    10. SimplifiedError: 4.9 bits

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

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

Reproduce

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