Average Error: 11.4 → 2.4
Time: 3.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -9.8896762186455276 \cdot 10^{56}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{elif}\;x \le 9.02230363154583301 \cdot 10^{-277}:\\ \;\;\;\;\frac{1}{\frac{t - z}{x \cdot \left(y - z\right)}}\\ \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}\;x \le -9.8896762186455276 \cdot 10^{56}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r623567 = x;
        double r623568 = y;
        double r623569 = z;
        double r623570 = r623568 - r623569;
        double r623571 = r623567 * r623570;
        double r623572 = t;
        double r623573 = r623572 - r623569;
        double r623574 = r623571 / r623573;
        return r623574;
}

double f(double x, double y, double z, double t) {
        double r623575 = x;
        double r623576 = -9.889676218645528e+56;
        bool r623577 = r623575 <= r623576;
        double r623578 = t;
        double r623579 = z;
        double r623580 = r623578 - r623579;
        double r623581 = r623575 / r623580;
        double r623582 = y;
        double r623583 = r623582 - r623579;
        double r623584 = r623581 * r623583;
        double r623585 = 9.022303631545833e-277;
        bool r623586 = r623575 <= r623585;
        double r623587 = 1.0;
        double r623588 = r623575 * r623583;
        double r623589 = r623580 / r623588;
        double r623590 = r623587 / r623589;
        double r623591 = r623580 / r623583;
        double r623592 = r623575 / r623591;
        double r623593 = r623586 ? r623590 : r623592;
        double r623594 = r623577 ? r623584 : r623593;
        return r623594;
}

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

Derivation

  1. Split input into 3 regimes
  2. if x < -9.889676218645528e+56

    1. Initial program 27.2

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

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

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

    if -9.889676218645528e+56 < x < 9.022303631545833e-277

    1. Initial program 2.3

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied clear-num2.6

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

    if 9.022303631545833e-277 < x

    1. Initial program 11.9

      \[\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}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.4

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

Reproduce

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