Average Error: 11.3 → 1.5
Time: 4.0s
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 r622166 = x;
        double r622167 = y;
        double r622168 = z;
        double r622169 = r622167 - r622168;
        double r622170 = r622166 * r622169;
        double r622171 = t;
        double r622172 = r622171 - r622168;
        double r622173 = r622170 / r622172;
        return r622173;
}

double f(double x, double y, double z, double t) {
        double r622174 = x;
        double r622175 = y;
        double r622176 = z;
        double r622177 = r622175 - r622176;
        double r622178 = r622174 * r622177;
        double r622179 = t;
        double r622180 = r622179 - r622176;
        double r622181 = r622178 / r622180;
        double r622182 = -8.669871286984032e+206;
        bool r622183 = r622181 <= r622182;
        double r622184 = 1.3701138578657516e+252;
        bool r622185 = r622181 <= r622184;
        double r622186 = !r622185;
        bool r622187 = r622183 || r622186;
        double r622188 = r622179 / r622177;
        double r622189 = r622176 / r622177;
        double r622190 = r622188 - r622189;
        double r622191 = r622174 / r622190;
        double r622192 = r622187 ? r622191 : r622181;
        return r622192;
}

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 +o rules:numerics
(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)))