Average Error: 11.2 → 1.1
Time: 10.9s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot x}{t - z} = -\infty:\\ \;\;\;\;\frac{y - z}{\frac{t - z}{x}}\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot x}{t - z} \le 2.164785590368067654753045725339164066048 \cdot 10^{245}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot x}{t - z} = -\infty:\\
\;\;\;\;\frac{y - z}{\frac{t - z}{x}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r538251 = x;
        double r538252 = y;
        double r538253 = z;
        double r538254 = r538252 - r538253;
        double r538255 = r538251 * r538254;
        double r538256 = t;
        double r538257 = r538256 - r538253;
        double r538258 = r538255 / r538257;
        return r538258;
}

double f(double x, double y, double z, double t) {
        double r538259 = y;
        double r538260 = z;
        double r538261 = r538259 - r538260;
        double r538262 = x;
        double r538263 = r538261 * r538262;
        double r538264 = t;
        double r538265 = r538264 - r538260;
        double r538266 = r538263 / r538265;
        double r538267 = -inf.0;
        bool r538268 = r538266 <= r538267;
        double r538269 = r538265 / r538262;
        double r538270 = r538261 / r538269;
        double r538271 = 2.1647855903680677e+245;
        bool r538272 = r538266 <= r538271;
        double r538273 = r538265 / r538261;
        double r538274 = r538262 / r538273;
        double r538275 = r538272 ? r538266 : r538274;
        double r538276 = r538268 ? r538270 : r538275;
        return r538276;
}

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.2
Target2.0
Herbie1.1
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < -inf.0

    1. Initial program 64.0

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

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

    if -inf.0 < (/ (* x (- y z)) (- t z)) < 2.1647855903680677e+245

    1. Initial program 1.2

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

    if 2.1647855903680677e+245 < (/ (* x (- y z)) (- t z))

    1. Initial program 55.3

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot x}{t - z} = -\infty:\\ \;\;\;\;\frac{y - z}{\frac{t - z}{x}}\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot x}{t - z} \le 2.164785590368067654753045725339164066048 \cdot 10^{245}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019194 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"

  :herbie-target
  (/ x (/ (- t z) (- y z)))

  (/ (* x (- y z)) (- t z)))