Average Error: 11.9 → 2.3
Time: 3.2s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\ \;\;\;\;x \cdot \frac{y - 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}
\mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\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 temp;
	if (((z <= -5.780955349548897e-116) || !(z <= 7.159359654939009e-78))) {
		temp = (x * ((y - z) / (t - z)));
	} else {
		temp = ((y - z) * (x / (t - z)));
	}
	return temp;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -5.780955349548897e-116 or 7.159359654939009e-78 < z

    1. Initial program 14.6

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

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

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

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

    if -5.780955349548897e-116 < z < 7.159359654939009e-78

    1. Initial program 6.0

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied div-sub5.9

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

      \[\leadsto \frac{x}{\frac{t}{y - z} - \color{blue}{z \cdot \frac{1}{y - z}}}\]
    8. Applied div-inv5.9

      \[\leadsto \frac{x}{\color{blue}{t \cdot \frac{1}{y - z}} - z \cdot \frac{1}{y - z}}\]
    9. Applied distribute-rgt-out--5.9

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{y - z} \cdot \left(t - z\right)}}\]
    10. Applied *-un-lft-identity5.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \end{array}\]

Reproduce

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