Average Error: 11.7 → 1.3
Time: 9.3s
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.346794426259102594254137850617104725668 \cdot 10^{-270}\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.346794426259102594254137850617104725668 \cdot 10^{-270}\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 r351487 = x;
        double r351488 = y;
        double r351489 = z;
        double r351490 = r351488 - r351489;
        double r351491 = r351487 * r351490;
        double r351492 = t;
        double r351493 = r351492 - r351489;
        double r351494 = r351491 / r351493;
        return r351494;
}

double f(double x, double y, double z, double t) {
        double r351495 = x;
        double r351496 = y;
        double r351497 = z;
        double r351498 = r351496 - r351497;
        double r351499 = r351495 * r351498;
        double r351500 = t;
        double r351501 = r351500 - r351497;
        double r351502 = r351499 / r351501;
        double r351503 = -inf.0;
        bool r351504 = r351502 <= r351503;
        double r351505 = -1.3467944262591026e-270;
        bool r351506 = r351502 <= r351505;
        double r351507 = !r351506;
        bool r351508 = r351504 || r351507;
        double r351509 = r351501 / r351498;
        double r351510 = r351495 / r351509;
        double r351511 = r351508 ? r351510 : r351502;
        return r351511;
}

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.7
Target2.2
Herbie1.3
\[\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.3467944262591026e-270 < (/ (* x (- y z)) (- t z))

    1. Initial program 17.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}}}\]

    if -inf.0 < (/ (* x (- y z)) (- t z)) < -1.3467944262591026e-270

    1. Initial program 0.3

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

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

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

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

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

    \[\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.346794426259102594254137850617104725668 \cdot 10^{-270}\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 2019304 +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)))