Average Error: 12.1 → 2.3
Time: 9.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.155924047883603900871162775757218637321 \cdot 10^{-263}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 8.757644994032034378013442251697187719343 \cdot 10^{-217}:\\ \;\;\;\;\frac{1}{t - z} \cdot \left(x \cdot \left(y - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -2.155924047883603900871162775757218637321 \cdot 10^{-263}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r451039 = x;
        double r451040 = y;
        double r451041 = z;
        double r451042 = r451040 - r451041;
        double r451043 = r451039 * r451042;
        double r451044 = t;
        double r451045 = r451044 - r451041;
        double r451046 = r451043 / r451045;
        return r451046;
}

double f(double x, double y, double z, double t) {
        double r451047 = z;
        double r451048 = -2.155924047883604e-263;
        bool r451049 = r451047 <= r451048;
        double r451050 = x;
        double r451051 = y;
        double r451052 = r451051 - r451047;
        double r451053 = t;
        double r451054 = r451053 - r451047;
        double r451055 = r451052 / r451054;
        double r451056 = r451050 * r451055;
        double r451057 = 8.757644994032034e-217;
        bool r451058 = r451047 <= r451057;
        double r451059 = 1.0;
        double r451060 = r451059 / r451054;
        double r451061 = r451050 * r451052;
        double r451062 = r451060 * r451061;
        double r451063 = r451054 / r451052;
        double r451064 = r451050 / r451063;
        double r451065 = r451058 ? r451062 : r451064;
        double r451066 = r451049 ? r451056 : r451065;
        return r451066;
}

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

Original12.1
Target2.2
Herbie2.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -2.155924047883604e-263

    1. Initial program 12.6

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

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

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

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

    if -2.155924047883604e-263 < z < 8.757644994032034e-217

    1. Initial program 7.4

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

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

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

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

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

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

    if 8.757644994032034e-217 < z

    1. Initial program 12.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.155924047883603900871162775757218637321 \cdot 10^{-263}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 8.757644994032034378013442251697187719343 \cdot 10^{-217}:\\ \;\;\;\;\frac{1}{t - z} \cdot \left(x \cdot \left(y - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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