Average Error: 11.9 → 2.4
Time: 3.3s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.30440867097708453 \cdot 10^{-106} \lor \neg \left(z \le 4.5683127974833349 \cdot 10^{-53}\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 -4.30440867097708453 \cdot 10^{-106} \lor \neg \left(z \le 4.5683127974833349 \cdot 10^{-53}\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 r625941 = x;
        double r625942 = y;
        double r625943 = z;
        double r625944 = r625942 - r625943;
        double r625945 = r625941 * r625944;
        double r625946 = t;
        double r625947 = r625946 - r625943;
        double r625948 = r625945 / r625947;
        return r625948;
}

double f(double x, double y, double z, double t) {
        double r625949 = z;
        double r625950 = -4.3044086709770845e-106;
        bool r625951 = r625949 <= r625950;
        double r625952 = 4.568312797483335e-53;
        bool r625953 = r625949 <= r625952;
        double r625954 = !r625953;
        bool r625955 = r625951 || r625954;
        double r625956 = x;
        double r625957 = y;
        double r625958 = r625957 - r625949;
        double r625959 = t;
        double r625960 = r625959 - r625949;
        double r625961 = r625958 / r625960;
        double r625962 = r625956 * r625961;
        double r625963 = r625956 / r625960;
        double r625964 = r625958 * r625963;
        double r625965 = r625955 ? r625962 : r625964;
        return r625965;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -4.3044086709770845e-106 or 4.568312797483335e-53 < z

    1. Initial program 15.3

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

      \[\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 -4.3044086709770845e-106 < z < 4.568312797483335e-53

    1. Initial program 5.6

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

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

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

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

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

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

      \[\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.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.30440867097708453 \cdot 10^{-106} \lor \neg \left(z \le 4.5683127974833349 \cdot 10^{-53}\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 2020036 
(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)))