Average Error: 11.6 → 1.1
Time: 3.5s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[\begin{array}{l} t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;t_1 \leq 9.296864973976425 \cdot 10^{+300}:\\ \;\;\;\;\frac{x \cdot y - x \cdot z}{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}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{elif}\;t_1 \leq 9.296864973976425 \cdot 10^{+300}:\\
\;\;\;\;\frac{x \cdot y - x \cdot z}{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
 (let* ((t_1 (/ (* x (- y z)) (- t z))))
   (if (<= t_1 (- INFINITY))
     (/ x (/ (- t z) (- y z)))
     (if (<= t_1 9.296864973976425e+300)
       (/ (- (* x y) (* x z)) (- t 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 t_1 = (x * (y - z)) / (t - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x / ((t - z) / (y - z));
	} else if (t_1 <= 9.296864973976425e+300) {
		tmp = ((x * y) - (x * z)) / (t - 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.6
Target2.2
Herbie1.1
\[\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. Applied associate-/l*_binary640.1

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

    if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 9.2968649739764245e300

    1. Initial program 1.3

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied *-un-lft-identity_binary641.3

      \[\leadsto \frac{x \cdot \left(y - \color{blue}{1 \cdot z}\right)}{t - z} \]
    3. Applied cancel-sign-sub-inv_binary641.3

      \[\leadsto \frac{x \cdot \color{blue}{\left(y + \left(-1\right) \cdot z\right)}}{t - z} \]
    4. Applied distribute-lft-in_binary641.3

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

    if 9.2968649739764245e300 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 63.1

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied *-un-lft-identity_binary6463.1

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

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

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

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

Reproduce

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