Average Error: 11.7 → 2.0
Time: 4.2s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.49095103490933882 \cdot 10^{-195}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \le 5.317812166204711 \cdot 10^{-269}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -4.49095103490933882 \cdot 10^{-195}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{elif}\;z \le 5.317812166204711 \cdot 10^{-269}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((z <= -4.490951034909339e-195)) {
		VAR = ((double) (x / ((double) (((double) (t - z)) / ((double) (y - z))))));
	} else {
		double VAR_1;
		if ((z <= 5.317812166204711e-269)) {
			VAR_1 = ((double) (((double) (x / ((double) (t - z)))) * ((double) (y - z))));
		} else {
			VAR_1 = ((double) (x * ((double) (((double) (y / ((double) (t - z)))) - ((double) (z / ((double) (t - z))))))));
		}
		VAR = VAR_1;
	}
	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.7
Target2.1
Herbie2.0
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -4.49095103490933882e-195

    1. Initial program 13.1

      \[\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 -4.49095103490933882e-195 < z < 5.317812166204711e-269

    1. Initial program 5.8

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.8

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
    6. Using strategy rm
    7. Applied div-sub6.6

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)}\]
    8. Using strategy rm
    9. Applied div-inv6.6

      \[\leadsto x \cdot \left(\frac{y}{t - z} - \color{blue}{z \cdot \frac{1}{t - z}}\right)\]
    10. Applied div-inv6.6

      \[\leadsto x \cdot \left(\color{blue}{y \cdot \frac{1}{t - z}} - z \cdot \frac{1}{t - z}\right)\]
    11. Applied distribute-rgt-out--6.6

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{t - z} \cdot \left(y - z\right)\right)}\]
    12. Applied associate-*r*5.9

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

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

    if 5.317812166204711e-269 < z

    1. Initial program 12.0

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity12.0

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
    6. Using strategy rm
    7. Applied div-sub1.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.49095103490933882 \cdot 10^{-195}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{elif}\;z \le 5.317812166204711 \cdot 10^{-269}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \end{array}\]

Reproduce

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