Average Error: 11.3 → 2.1
Time: 4.3s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[\begin{array}{l} t_1 := x \cdot \frac{y - z}{t - z}\\ \mathbf{if}\;z \leq -1.9332557615753545 \cdot 10^{-212}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.0967477663018776 \cdot 10^{-139}:\\ \;\;\;\;\frac{y - z}{\left(t - z\right) \cdot \frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t - z}\\
\mathbf{if}\;z \leq -1.9332557615753545 \cdot 10^{-212}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 6.0967477663018776 \cdot 10^{-139}:\\
\;\;\;\;\frac{y - z}{\left(t - z\right) \cdot \frac{1}{x}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\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 (<= z -1.9332557615753545e-212)
     t_1
     (if (<= z 6.0967477663018776e-139)
       (/ (- y z) (* (- t z) (/ 1.0 x)))
       t_1))))
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 (z <= -1.9332557615753545e-212) {
		tmp = t_1;
	} else if (z <= 6.0967477663018776e-139) {
		tmp = (y - z) / ((t - z) * (1.0 / x));
	} else {
		tmp = t_1;
	}
	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.3
Target2.1
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}} \]

Derivation

  1. Split input into 2 regimes
  2. if z < -1.9332557615753545e-212 or 6.09674776630187758e-139 < z

    1. Initial program 12.5

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied egg-rr1.2

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

    if -1.9332557615753545e-212 < z < 6.09674776630187758e-139

    1. Initial program 6.3

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Applied egg-rr5.6

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}} \]
    3. Applied egg-rr5.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9332557615753545 \cdot 10^{-212}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \leq 6.0967477663018776 \cdot 10^{-139}:\\ \;\;\;\;\frac{y - z}{\left(t - z\right) \cdot \frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array} \]

Reproduce

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