Average Error: 11.3 → 2.4
Time: 8.1s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33}:\\ \;\;\;\;\frac{x}{t \cdot \frac{1}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;z \le -1.7069294686818465 \cdot 10^{-261}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33}:\\
\;\;\;\;\frac{x}{t \cdot \frac{1}{y - z} - \frac{z}{y - z}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r593988 = x;
        double r593989 = y;
        double r593990 = z;
        double r593991 = r593989 - r593990;
        double r593992 = r593988 * r593991;
        double r593993 = t;
        double r593994 = r593993 - r593990;
        double r593995 = r593992 / r593994;
        return r593995;
}

double f(double x, double y, double z, double t) {
        double r593996 = z;
        double r593997 = -1.390173372602323e+33;
        bool r593998 = r593996 <= r593997;
        double r593999 = x;
        double r594000 = t;
        double r594001 = 1.0;
        double r594002 = y;
        double r594003 = r594002 - r593996;
        double r594004 = r594001 / r594003;
        double r594005 = r594000 * r594004;
        double r594006 = r593996 / r594003;
        double r594007 = r594005 - r594006;
        double r594008 = r593999 / r594007;
        double r594009 = -1.7069294686818465e-261;
        bool r594010 = r593996 <= r594009;
        double r594011 = r594000 - r593996;
        double r594012 = r593999 / r594011;
        double r594013 = r594012 * r594003;
        double r594014 = r594000 / r594003;
        double r594015 = r594014 - r594006;
        double r594016 = r593999 / r594015;
        double r594017 = r594010 ? r594013 : r594016;
        double r594018 = r593998 ? r594008 : r594017;
        return r594018;
}

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

Derivation

  1. Split input into 3 regimes
  2. if z < -1.390173372602323e+33

    1. Initial program 18.4

      \[\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-sub0.1

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z} - \frac{z}{y - z}}}\]
    6. Using strategy rm
    7. Applied div-inv0.1

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

    if -1.390173372602323e+33 < z < -1.7069294686818465e-261

    1. Initial program 5.1

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z} - \frac{z}{y - z}}}\]
    6. Using strategy rm
    7. Applied div-inv3.3

      \[\leadsto \frac{x}{\color{blue}{t \cdot \frac{1}{y - z}} - \frac{z}{y - z}}\]
    8. Using strategy rm
    9. Applied un-div-inv3.2

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z}} - \frac{z}{y - z}}\]
    10. Applied sub-div3.2

      \[\leadsto \frac{x}{\color{blue}{\frac{t - z}{y - z}}}\]
    11. Applied associate-/r/4.6

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

    if -1.7069294686818465e-261 < z

    1. Initial program 10.7

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

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

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

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

Reproduce

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