Average Error: 11.5 → 1.0
Time: 4.2s
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 -4.1751177849371118 \cdot 10^{281}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -5.94230620035678171 \cdot 10^{-186}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 6.092106030880753 \cdot 10^{-163}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 3.74492447888945537 \cdot 10^{219}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - 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 -4.1751177849371118 \cdot 10^{281}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r638870 = x;
        double r638871 = y;
        double r638872 = z;
        double r638873 = r638871 - r638872;
        double r638874 = r638870 * r638873;
        double r638875 = t;
        double r638876 = r638875 - r638872;
        double r638877 = r638874 / r638876;
        return r638877;
}

double f(double x, double y, double z, double t) {
        double r638878 = x;
        double r638879 = y;
        double r638880 = z;
        double r638881 = r638879 - r638880;
        double r638882 = r638878 * r638881;
        double r638883 = t;
        double r638884 = r638883 - r638880;
        double r638885 = r638882 / r638884;
        double r638886 = -4.175117784937112e+281;
        bool r638887 = r638885 <= r638886;
        double r638888 = r638883 / r638881;
        double r638889 = r638880 / r638881;
        double r638890 = r638888 - r638889;
        double r638891 = r638878 / r638890;
        double r638892 = -5.942306200356782e-186;
        bool r638893 = r638885 <= r638892;
        double r638894 = 6.092106030880753e-163;
        bool r638895 = r638885 <= r638894;
        double r638896 = r638879 / r638884;
        double r638897 = r638880 / r638884;
        double r638898 = r638896 - r638897;
        double r638899 = r638878 * r638898;
        double r638900 = 3.7449244788894554e+219;
        bool r638901 = r638885 <= r638900;
        double r638902 = r638901 ? r638885 : r638899;
        double r638903 = r638895 ? r638899 : r638902;
        double r638904 = r638893 ? r638885 : r638903;
        double r638905 = r638887 ? r638891 : r638904;
        return r638905;
}

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

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < -4.175117784937112e+281

    1. Initial program 60.5

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

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

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

    if -4.175117784937112e+281 < (/ (* x (- y z)) (- t z)) < -5.942306200356782e-186 or 6.092106030880753e-163 < (/ (* x (- y z)) (- t z)) < 3.7449244788894554e+219

    1. Initial program 0.3

      \[\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 div-sub2.6

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

      \[\leadsto \frac{x}{\frac{t}{y - z} - \color{blue}{z \cdot \frac{1}{y - z}}}\]
    8. Applied div-inv2.7

      \[\leadsto \frac{x}{\color{blue}{t \cdot \frac{1}{y - z}} - z \cdot \frac{1}{y - z}}\]
    9. Applied distribute-rgt-out--2.7

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{y - z} \cdot \left(t - z\right)}}\]
    10. Applied associate-/r*0.4

      \[\leadsto \color{blue}{\frac{\frac{x}{\frac{1}{y - z}}}{t - z}}\]
    11. Simplified0.3

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

    if -5.942306200356782e-186 < (/ (* x (- y z)) (- t z)) < 6.092106030880753e-163 or 3.7449244788894554e+219 < (/ (* x (- y z)) (- t z))

    1. Initial program 16.0

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -4.1751177849371118 \cdot 10^{281}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -5.94230620035678171 \cdot 10^{-186}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 6.092106030880753 \cdot 10^{-163}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 3.74492447888945537 \cdot 10^{219}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\ \end{array}\]

Reproduce

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