Average Error: 11.4 → 1.7
Time: 3.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} \le 0.0:\\ \;\;\;\;\frac{x}{{\left(\frac{t - z}{y - z}\right)}^{1}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 2.28593216958903165 \cdot 10^{67}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \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 0.0:\\
\;\;\;\;\frac{x}{{\left(\frac{t - z}{y - z}\right)}^{1}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r485561 = x;
        double r485562 = y;
        double r485563 = z;
        double r485564 = r485562 - r485563;
        double r485565 = r485561 * r485564;
        double r485566 = t;
        double r485567 = r485566 - r485563;
        double r485568 = r485565 / r485567;
        return r485568;
}

double f(double x, double y, double z, double t) {
        double r485569 = x;
        double r485570 = y;
        double r485571 = z;
        double r485572 = r485570 - r485571;
        double r485573 = r485569 * r485572;
        double r485574 = t;
        double r485575 = r485574 - r485571;
        double r485576 = r485573 / r485575;
        double r485577 = 0.0;
        bool r485578 = r485576 <= r485577;
        double r485579 = r485575 / r485572;
        double r485580 = 1.0;
        double r485581 = pow(r485579, r485580);
        double r485582 = r485569 / r485581;
        double r485583 = 2.2859321695890317e+67;
        bool r485584 = r485576 <= r485583;
        double r485585 = r485569 / r485575;
        double r485586 = r485585 * r485572;
        double r485587 = r485584 ? r485576 : r485586;
        double r485588 = r485578 ? r485582 : r485587;
        return r485588;
}

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

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < 0.0

    1. Initial program 11.1

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

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

      \[\leadsto \frac{x}{\color{blue}{{\left(\frac{t - z}{y - z}\right)}^{1}}}\]

    if 0.0 < (/ (* x (- y z)) (- t z)) < 2.2859321695890317e+67

    1. Initial program 0.3

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

    if 2.2859321695890317e+67 < (/ (* x (- y z)) (- t z))

    1. Initial program 29.5

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/3.1

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

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

Reproduce

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