Average Error: 11.9 → 2.1
Time: 2.9s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.29927142667181471 \cdot 10^{-59} \lor \neg \left(z \le -8.2043700554885046 \cdot 10^{-288}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -3.29927142667181471 \cdot 10^{-59} \lor \neg \left(z \le -8.2043700554885046 \cdot 10^{-288}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r655777 = x;
        double r655778 = y;
        double r655779 = z;
        double r655780 = r655778 - r655779;
        double r655781 = r655777 * r655780;
        double r655782 = t;
        double r655783 = r655782 - r655779;
        double r655784 = r655781 / r655783;
        return r655784;
}

double f(double x, double y, double z, double t) {
        double r655785 = z;
        double r655786 = -3.2992714266718147e-59;
        bool r655787 = r655785 <= r655786;
        double r655788 = -8.204370055488505e-288;
        bool r655789 = r655785 <= r655788;
        double r655790 = !r655789;
        bool r655791 = r655787 || r655790;
        double r655792 = x;
        double r655793 = t;
        double r655794 = r655793 - r655785;
        double r655795 = y;
        double r655796 = r655795 - r655785;
        double r655797 = r655794 / r655796;
        double r655798 = r655792 / r655797;
        double r655799 = r655792 * r655796;
        double r655800 = r655799 / r655794;
        double r655801 = r655791 ? r655798 : r655800;
        return r655801;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -3.2992714266718147e-59 or -8.204370055488505e-288 < z

    1. Initial program 13.3

      \[\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}}}\]

    if -3.2992714266718147e-59 < z < -8.204370055488505e-288

    1. Initial program 4.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.29927142667181471 \cdot 10^{-59} \lor \neg \left(z \le -8.2043700554885046 \cdot 10^{-288}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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