Average Error: 11.8 → 1.2
Time: 3.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} = -\infty:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -2.55577104147572557 \cdot 10^{-306}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{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{x \cdot \left(y - z\right)}{t - z} = -\infty:\\
\;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r558249 = x;
        double r558250 = y;
        double r558251 = z;
        double r558252 = r558250 - r558251;
        double r558253 = r558249 * r558252;
        double r558254 = t;
        double r558255 = r558254 - r558251;
        double r558256 = r558253 / r558255;
        return r558256;
}

double f(double x, double y, double z, double t) {
        double r558257 = x;
        double r558258 = y;
        double r558259 = z;
        double r558260 = r558258 - r558259;
        double r558261 = r558257 * r558260;
        double r558262 = t;
        double r558263 = r558262 - r558259;
        double r558264 = r558261 / r558263;
        double r558265 = -inf.0;
        bool r558266 = r558264 <= r558265;
        double r558267 = r558257 / r558263;
        double r558268 = 1.0;
        double r558269 = r558268 / r558260;
        double r558270 = r558267 / r558269;
        double r558271 = -2.5557710414757256e-306;
        bool r558272 = r558264 <= r558271;
        double r558273 = r558263 / r558260;
        double r558274 = r558257 / r558273;
        double r558275 = r558272 ? r558264 : r558274;
        double r558276 = r558266 ? r558270 : r558275;
        return r558276;
}

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.8
Target2.1
Herbie1.2
\[\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. Using strategy rm
    3. Applied associate-/l*0.1

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

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

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

    if -inf.0 < (/ (* x (- y z)) (- t z)) < -2.5557710414757256e-306

    1. Initial program 0.3

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

    if -2.5557710414757256e-306 < (/ (* x (- y z)) (- t z))

    1. Initial program 11.6

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

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

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

Reproduce

herbie shell --seed 2020064 +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)))