Average Error: 11.3 → 1.5
Time: 3.2s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -8.66987128698403154 \cdot 10^{206} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 1.37011385786575164 \cdot 10^{252}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -8.66987128698403154 \cdot 10^{206} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 1.37011385786575164 \cdot 10^{252}\right):\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r531340 = x;
        double r531341 = y;
        double r531342 = z;
        double r531343 = r531341 - r531342;
        double r531344 = r531340 * r531343;
        double r531345 = t;
        double r531346 = r531345 - r531342;
        double r531347 = r531344 / r531346;
        return r531347;
}

double f(double x, double y, double z, double t) {
        double r531348 = x;
        double r531349 = y;
        double r531350 = z;
        double r531351 = r531349 - r531350;
        double r531352 = r531348 * r531351;
        double r531353 = t;
        double r531354 = r531353 - r531350;
        double r531355 = r531352 / r531354;
        double r531356 = -8.669871286984032e+206;
        bool r531357 = r531355 <= r531356;
        double r531358 = 1.3701138578657516e+252;
        bool r531359 = r531355 <= r531358;
        double r531360 = !r531359;
        bool r531361 = r531357 || r531360;
        double r531362 = r531353 / r531351;
        double r531363 = r531350 / r531351;
        double r531364 = r531362 - r531363;
        double r531365 = r531348 / r531364;
        double r531366 = r531361 ? r531365 : r531355;
        return r531366;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (* x (- y z)) (- t z)) < -8.669871286984032e+206 or 1.3701138578657516e+252 < (/ (* x (- y z)) (- t z))

    1. Initial program 51.6

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

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

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

    if -8.669871286984032e+206 < (/ (* x (- y z)) (- t z)) < 1.3701138578657516e+252

    1. Initial program 1.5

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

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z}\]
    6. Using strategy rm
    7. Applied associate-*r/1.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -8.66987128698403154 \cdot 10^{206} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 1.37011385786575164 \cdot 10^{252}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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