Average Error: 2.1 → 0.9
Time: 3.3s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

\end{array}
double f(double x, double y, double z, double t) {
        double r494510 = x;
        double r494511 = y;
        double r494512 = r494510 - r494511;
        double r494513 = z;
        double r494514 = r494513 - r494511;
        double r494515 = r494512 / r494514;
        double r494516 = t;
        double r494517 = r494515 * r494516;
        return r494517;
}

double f(double x, double y, double z, double t) {
        double r494518 = x;
        double r494519 = y;
        double r494520 = r494518 - r494519;
        double r494521 = z;
        double r494522 = r494521 - r494519;
        double r494523 = r494520 / r494522;
        double r494524 = -1.7918506214892867e+299;
        bool r494525 = r494523 <= r494524;
        double r494526 = -1.147155901590016e-143;
        bool r494527 = r494523 <= r494526;
        double r494528 = 1.5457767632901e-317;
        bool r494529 = r494523 <= r494528;
        double r494530 = !r494529;
        bool r494531 = r494527 || r494530;
        double r494532 = !r494531;
        bool r494533 = r494525 || r494532;
        double r494534 = t;
        double r494535 = r494534 * r494520;
        double r494536 = r494535 / r494522;
        double r494537 = r494523 * r494534;
        double r494538 = r494533 ? r494536 : r494537;
        return r494538;
}

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

Original2.1
Target2.1
Herbie0.9
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (- x y) (- z y)) < -1.7918506214892867e+299 or -1.147155901590016e-143 < (/ (- x y) (- z y)) < 1.5457767632901e-317

    1. Initial program 12.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied div-inv12.6

      \[\leadsto \color{blue}{\left(\left(x - y\right) \cdot \frac{1}{z - y}\right)} \cdot t\]
    4. Using strategy rm
    5. Applied un-div-inv12.6

      \[\leadsto \color{blue}{\frac{x - y}{z - y}} \cdot t\]
    6. Applied associate-*l/1.7

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

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

    if -1.7918506214892867e+299 < (/ (- x y) (- z y)) < -1.147155901590016e-143 or 1.5457767632901e-317 < (/ (- x y) (- z y))

    1. Initial program 0.8

      \[\frac{x - y}{z - y} \cdot t\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \le -1.7918506214892867 \cdot 10^{299} \lor \neg \left(\frac{x - y}{z - y} \le -1.1471559015900161 \cdot 10^{-143} \lor \neg \left(\frac{x - y}{z - y} \le 1.54577676 \cdot 10^{-317}\right)\right):\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))