Average Error: 11.4 → 2.2
Time: 14.4s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -15118885371134948671347587713236746633220:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - 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}\;x \le -15118885371134948671347587713236746633220:\\
\;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - 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 r400903 = x;
        double r400904 = y;
        double r400905 = z;
        double r400906 = r400904 - r400905;
        double r400907 = r400903 * r400906;
        double r400908 = t;
        double r400909 = r400908 - r400905;
        double r400910 = r400907 / r400909;
        return r400910;
}

double f(double x, double y, double z, double t) {
        double r400911 = x;
        double r400912 = -1.5118885371134949e+40;
        bool r400913 = r400911 <= r400912;
        double r400914 = t;
        double r400915 = z;
        double r400916 = r400914 - r400915;
        double r400917 = r400911 / r400916;
        double r400918 = 1.0;
        double r400919 = y;
        double r400920 = r400919 - r400915;
        double r400921 = r400918 / r400920;
        double r400922 = r400917 / r400921;
        double r400923 = r400914 / r400920;
        double r400924 = r400915 / r400920;
        double r400925 = r400923 - r400924;
        double r400926 = r400911 / r400925;
        double r400927 = r400913 ? r400922 : r400926;
        return r400927;
}

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

Derivation

  1. Split input into 2 regimes
  2. if x < -1.5118885371134949e+40

    1. Initial program 25.8

      \[\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-inv3.4

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

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

    if -1.5118885371134949e+40 < x

    1. Initial program 7.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}}}\]
    4. Using strategy rm
    5. Applied div-sub2.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -15118885371134948671347587713236746633220:\\ \;\;\;\;\frac{\frac{x}{t - z}}{\frac{1}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]

Reproduce

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