Average Error: 11.4 → 2.0
Time: 11.7s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -8.726304656018531819300142822203594286686 \cdot 10^{-127}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 5.053145887258634704264236509855086113897 \cdot 10^{-231}:\\ \;\;\;\;\frac{x \cdot y + x \cdot \left(-z\right)}{t - z}\\ \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 -8.726304656018531819300142822203594286686 \cdot 10^{-127}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\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 r473884 = x;
        double r473885 = y;
        double r473886 = z;
        double r473887 = r473885 - r473886;
        double r473888 = r473884 * r473887;
        double r473889 = t;
        double r473890 = r473889 - r473886;
        double r473891 = r473888 / r473890;
        return r473891;
}

double f(double x, double y, double z, double t) {
        double r473892 = z;
        double r473893 = -8.726304656018532e-127;
        bool r473894 = r473892 <= r473893;
        double r473895 = x;
        double r473896 = y;
        double r473897 = r473896 - r473892;
        double r473898 = t;
        double r473899 = r473898 - r473892;
        double r473900 = r473897 / r473899;
        double r473901 = r473895 * r473900;
        double r473902 = 5.0531458872586347e-231;
        bool r473903 = r473892 <= r473902;
        double r473904 = r473895 * r473896;
        double r473905 = -r473892;
        double r473906 = r473895 * r473905;
        double r473907 = r473904 + r473906;
        double r473908 = r473907 / r473899;
        double r473909 = r473898 / r473897;
        double r473910 = r473892 / r473897;
        double r473911 = r473909 - r473910;
        double r473912 = r473895 / r473911;
        double r473913 = r473903 ? r473908 : r473912;
        double r473914 = r473894 ? r473901 : r473913;
        return r473914;
}

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

Derivation

  1. Split input into 3 regimes
  2. if z < -8.726304656018532e-127

    1. Initial program 13.2

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

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

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

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

    if -8.726304656018532e-127 < z < 5.0531458872586347e-231

    1. Initial program 5.5

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied sub-neg5.5

      \[\leadsto \frac{x \cdot \color{blue}{\left(y + \left(-z\right)\right)}}{t - z}\]
    4. Applied distribute-lft-in5.5

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

    if 5.0531458872586347e-231 < z

    1. Initial program 12.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -8.726304656018531819300142822203594286686 \cdot 10^{-127}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 5.053145887258634704264236509855086113897 \cdot 10^{-231}:\\ \;\;\;\;\frac{x \cdot y + x \cdot \left(-z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]

Reproduce

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