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}{{\left(\frac{t - z}{y - z}\right)}^{1}}\\ \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}{{\left(\frac{t - z}{y - z}\right)}^{1}}\\

\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 r745935 = x;
        double r745936 = y;
        double r745937 = z;
        double r745938 = r745936 - r745937;
        double r745939 = r745935 * r745938;
        double r745940 = t;
        double r745941 = r745940 - r745937;
        double r745942 = r745939 / r745941;
        return r745942;
}

double f(double x, double y, double z, double t) {
        double r745943 = z;
        double r745944 = 1.3697525266715117e-295;
        bool r745945 = r745943 <= r745944;
        double r745946 = 1.627532321675119e-108;
        bool r745947 = r745943 <= r745946;
        double r745948 = !r745947;
        bool r745949 = r745945 || r745948;
        double r745950 = x;
        double r745951 = t;
        double r745952 = r745951 - r745943;
        double r745953 = y;
        double r745954 = r745953 - r745943;
        double r745955 = r745952 / r745954;
        double r745956 = 1.0;
        double r745957 = pow(r745955, r745956);
        double r745958 = r745950 / r745957;
        double r745959 = r745950 * r745954;
        double r745960 = r745952 / r745959;
        double r745961 = r745956 / r745960;
        double r745962 = r745949 ? r745958 : r745961;
        return r745962;
}

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 pow11.9

      \[\leadsto \frac{x}{\left(t - z\right) \cdot \color{blue}{{\left(\frac{1}{y - z}\right)}^{1}}}\]
    8. Applied pow11.9

      \[\leadsto \frac{x}{\color{blue}{{\left(t - z\right)}^{1}} \cdot {\left(\frac{1}{y - z}\right)}^{1}}\]
    9. Applied pow-prod-down1.9

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

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

    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}{{\left(\frac{t - z}{y - z}\right)}^{1}}\\ \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)))