Average Error: 11.9 → 2.3
Time: 3.1s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r621075 = x;
        double r621076 = y;
        double r621077 = z;
        double r621078 = r621076 - r621077;
        double r621079 = r621075 * r621078;
        double r621080 = t;
        double r621081 = r621080 - r621077;
        double r621082 = r621079 / r621081;
        return r621082;
}

double f(double x, double y, double z, double t) {
        double r621083 = z;
        double r621084 = -5.780955349548897e-116;
        bool r621085 = r621083 <= r621084;
        double r621086 = 7.159359654939009e-78;
        bool r621087 = r621083 <= r621086;
        double r621088 = !r621087;
        bool r621089 = r621085 || r621088;
        double r621090 = x;
        double r621091 = y;
        double r621092 = r621091 - r621083;
        double r621093 = t;
        double r621094 = r621093 - r621083;
        double r621095 = r621092 / r621094;
        double r621096 = r621090 * r621095;
        double r621097 = r621090 / r621094;
        double r621098 = r621092 * r621097;
        double r621099 = r621089 ? r621096 : r621098;
        return r621099;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -5.780955349548897e-116 or 7.159359654939009e-78 < z

    1. Initial program 14.6

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

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

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

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

    if -5.780955349548897e-116 < z < 7.159359654939009e-78

    1. Initial program 6.0

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

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{y - z} \cdot \left(t - z\right)}}\]
    10. Applied *-un-lft-identity5.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.78095534954889683 \cdot 10^{-116} \lor \neg \left(z \le 7.1593596549390092 \cdot 10^{-78}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020060 
(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)))