Average Error: 12.4 → 2.3
Time: 2.9s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.82582666524392251897185659068836574668 \cdot 10^{-56} \lor \neg \left(z \le -5.665755331296606056273270283470068418052 \cdot 10^{-202}\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 -4.82582666524392251897185659068836574668 \cdot 10^{-56} \lor \neg \left(z \le -5.665755331296606056273270283470068418052 \cdot 10^{-202}\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 r603426 = x;
        double r603427 = y;
        double r603428 = z;
        double r603429 = r603427 - r603428;
        double r603430 = r603426 * r603429;
        double r603431 = t;
        double r603432 = r603431 - r603428;
        double r603433 = r603430 / r603432;
        return r603433;
}

double f(double x, double y, double z, double t) {
        double r603434 = z;
        double r603435 = -4.8258266652439225e-56;
        bool r603436 = r603434 <= r603435;
        double r603437 = -5.665755331296606e-202;
        bool r603438 = r603434 <= r603437;
        double r603439 = !r603438;
        bool r603440 = r603436 || r603439;
        double r603441 = x;
        double r603442 = t;
        double r603443 = r603442 - r603434;
        double r603444 = y;
        double r603445 = r603444 - r603434;
        double r603446 = r603443 / r603445;
        double r603447 = r603441 / r603446;
        double r603448 = r603441 / r603443;
        double r603449 = r603448 * r603445;
        double r603450 = r603440 ? r603447 : r603449;
        return r603450;
}

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

Original12.4
Target2.4
Herbie2.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -4.8258266652439225e-56 or -5.665755331296606e-202 < z

    1. Initial program 13.3

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

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

    if -4.8258266652439225e-56 < z < -5.665755331296606e-202

    1. Initial program 5.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.82582666524392251897185659068836574668 \cdot 10^{-56} \lor \neg \left(z \le -5.665755331296606056273270283470068418052 \cdot 10^{-202}\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 2020002 
(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)))