Average Error: 11.6 → 1.2
Time: 2.9s
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 \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 1.20717187546237189 \cdot 10^{217}\right):\\ \;\;\;\;\frac{x}{\frac{t - 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} = -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \le 1.20717187546237189 \cdot 10^{217}\right):\\
\;\;\;\;\frac{x}{\frac{t - 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 r600539 = x;
        double r600540 = y;
        double r600541 = z;
        double r600542 = r600540 - r600541;
        double r600543 = r600539 * r600542;
        double r600544 = t;
        double r600545 = r600544 - r600541;
        double r600546 = r600543 / r600545;
        return r600546;
}

double f(double x, double y, double z, double t) {
        double r600547 = x;
        double r600548 = y;
        double r600549 = z;
        double r600550 = r600548 - r600549;
        double r600551 = r600547 * r600550;
        double r600552 = t;
        double r600553 = r600552 - r600549;
        double r600554 = r600551 / r600553;
        double r600555 = -inf.0;
        bool r600556 = r600554 <= r600555;
        double r600557 = 1.207171875462372e+217;
        bool r600558 = r600554 <= r600557;
        double r600559 = !r600558;
        bool r600560 = r600556 || r600559;
        double r600561 = r600553 / r600550;
        double r600562 = r600547 / r600561;
        double r600563 = r600560 ? r600562 : r600554;
        return r600563;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (* x (- y z)) (- t z)) < -inf.0 or 1.207171875462372e+217 < (/ (* x (- y z)) (- t z))

    1. Initial program 55.6

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

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

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

    1. Initial program 1.2

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

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

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

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

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

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

Reproduce

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