Average Error: 10.2 → 1.3
Time: 3.7s
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 6.656739515096712 \cdot 10^{+236}:\\ \;\;\;\;\frac{x \cdot y - x \cdot z}{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}
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 6.656739515096712 \cdot 10^{+236}:\\
\;\;\;\;\frac{x \cdot y - x \cdot z}{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
 (let* ((t_1 (/ (* x (- y z)) (- t z))))
   (if (<= t_1 (- INFINITY))
     (/ x (/ (- t z) (- y z)))
     (if (<= t_1 6.656739515096712e+236)
       (/ (- (* x y) (* x 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 t_1 = (x * (y - z)) / (t - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x / ((t - z) / (y - z));
	} else if (t_1 <= 6.656739515096712e+236) {
		tmp = ((x * y) - (x * 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

Original10.2
Target2.1
Herbie1.3
\[\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 38.9

      \[\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)) < 6.656739515096712e236

    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 6.656739515096712e236 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 35.6

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    3. Applied associate-/r/_binary642.2

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

Reproduce

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