Average Error: 11.4 → 2.2
Time: 4.0s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.774941709796473919963699961412214284686 \cdot 10^{-102} \lor \neg \left(z \le 2.757065980146846613575356502699254346611 \cdot 10^{-265}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -5.774941709796473919963699961412214284686 \cdot 10^{-102} \lor \neg \left(z \le 2.757065980146846613575356502699254346611 \cdot 10^{-265}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r656441 = x;
        double r656442 = y;
        double r656443 = z;
        double r656444 = r656442 - r656443;
        double r656445 = r656441 * r656444;
        double r656446 = t;
        double r656447 = r656446 - r656443;
        double r656448 = r656445 / r656447;
        return r656448;
}

double f(double x, double y, double z, double t) {
        double r656449 = z;
        double r656450 = -5.774941709796474e-102;
        bool r656451 = r656449 <= r656450;
        double r656452 = 2.7570659801468466e-265;
        bool r656453 = r656449 <= r656452;
        double r656454 = !r656453;
        bool r656455 = r656451 || r656454;
        double r656456 = x;
        double r656457 = t;
        double r656458 = r656457 - r656449;
        double r656459 = y;
        double r656460 = r656459 - r656449;
        double r656461 = r656458 / r656460;
        double r656462 = r656456 / r656461;
        double r656463 = r656456 / r656458;
        double r656464 = r656463 * r656460;
        double r656465 = r656455 ? r656462 : r656464;
        return r656465;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -5.774941709796474e-102 or 2.7570659801468466e-265 < z

    1. Initial program 12.6

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

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

    if -5.774941709796474e-102 < z < 2.7570659801468466e-265

    1. Initial program 5.9

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/6.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.774941709796473919963699961412214284686 \cdot 10^{-102} \lor \neg \left(z \le 2.757065980146846613575356502699254346611 \cdot 10^{-265}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \end{array}\]

Reproduce

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