Average Error: 11.6 → 2.3
Time: 4.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.37659876275777375 \cdot 10^{-131} \lor \neg \left(z \le 2.66649033172118856 \cdot 10^{-202}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \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 \le -2.37659876275777375 \cdot 10^{-131} \lor \neg \left(z \le 2.66649033172118856 \cdot 10^{-202}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

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

\end{array}
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 VAR;
	if (((z <= -2.3765987627577737e-131) || !(z <= 2.6664903317211886e-202))) {
		VAR = (x / ((t - z) / (y - z)));
	} else {
		VAR = ((x / (t - z)) * (y - z));
	}
	return VAR;
}

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.3
Herbie2.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -2.3765987627577737e-131 or 2.6664903317211886e-202 < z

    1. Initial program 13.0

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

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

    if -2.3765987627577737e-131 < z < 2.6664903317211886e-202

    1. Initial program 6.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.37659876275777375 \cdot 10^{-131} \lor \neg \left(z \le 2.66649033172118856 \cdot 10^{-202}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \end{array}\]

Reproduce

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