Average Error: 11.7 → 2.3
Time: 3.4s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le 1.369752526671511722658526908528908232804 \cdot 10^{-295} \lor \neg \left(z \le 1.627532321675118910729324718829559319672 \cdot 10^{-108}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{t - z}{x \cdot \left(y - z\right)}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le 1.369752526671511722658526908528908232804 \cdot 10^{-295} \lor \neg \left(z \le 1.627532321675118910729324718829559319672 \cdot 10^{-108}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r849723 = x;
        double r849724 = y;
        double r849725 = z;
        double r849726 = r849724 - r849725;
        double r849727 = r849723 * r849726;
        double r849728 = t;
        double r849729 = r849728 - r849725;
        double r849730 = r849727 / r849729;
        return r849730;
}

double f(double x, double y, double z, double t) {
        double r849731 = z;
        double r849732 = 1.3697525266715117e-295;
        bool r849733 = r849731 <= r849732;
        double r849734 = 1.627532321675119e-108;
        bool r849735 = r849731 <= r849734;
        double r849736 = !r849735;
        bool r849737 = r849733 || r849736;
        double r849738 = x;
        double r849739 = t;
        double r849740 = r849739 - r849731;
        double r849741 = y;
        double r849742 = r849741 - r849731;
        double r849743 = r849740 / r849742;
        double r849744 = r849738 / r849743;
        double r849745 = 1.0;
        double r849746 = r849738 * r849742;
        double r849747 = r849740 / r849746;
        double r849748 = r849745 / r849747;
        double r849749 = r849737 ? r849744 : r849748;
        return r849749;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < 1.3697525266715117e-295 or 1.627532321675119e-108 < z

    1. Initial program 12.6

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot \frac{1}{y - z}}}\]
    6. Using strategy rm
    7. Applied un-div-inv1.7

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

    if 1.3697525266715117e-295 < z < 1.627532321675119e-108

    1. Initial program 5.6

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied clear-num5.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le 1.369752526671511722658526908528908232804 \cdot 10^{-295} \lor \neg \left(z \le 1.627532321675118910729324718829559319672 \cdot 10^{-108}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{t - z}{x \cdot \left(y - z\right)}}\\ \end{array}\]

Reproduce

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