Average Error: 2.0 → 2.0
Time: 18.0s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.073388601361955291545855403151588574509 \cdot 10^{-267} \lor \neg \left(y \le 1.188637650407096621287004044639126749192 \cdot 10^{-194}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -1.073388601361955291545855403151588574509 \cdot 10^{-267} \lor \neg \left(y \le 1.188637650407096621287004044639126749192 \cdot 10^{-194}\right):\\
\;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r325338 = x;
        double r325339 = y;
        double r325340 = r325338 - r325339;
        double r325341 = z;
        double r325342 = r325341 - r325339;
        double r325343 = r325340 / r325342;
        double r325344 = t;
        double r325345 = r325343 * r325344;
        return r325345;
}

double f(double x, double y, double z, double t) {
        double r325346 = y;
        double r325347 = -1.0733886013619553e-267;
        bool r325348 = r325346 <= r325347;
        double r325349 = 1.1886376504070966e-194;
        bool r325350 = r325346 <= r325349;
        double r325351 = !r325350;
        bool r325352 = r325348 || r325351;
        double r325353 = x;
        double r325354 = z;
        double r325355 = r325354 - r325346;
        double r325356 = r325353 / r325355;
        double r325357 = r325346 / r325355;
        double r325358 = r325356 - r325357;
        double r325359 = t;
        double r325360 = r325358 * r325359;
        double r325361 = r325353 - r325346;
        double r325362 = r325361 * r325359;
        double r325363 = r325362 / r325355;
        double r325364 = r325352 ? r325360 : r325363;
        return r325364;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -1.0733886013619553e-267 or 1.1886376504070966e-194 < y

    1. Initial program 1.5

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

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

    if -1.0733886013619553e-267 < y < 1.1886376504070966e-194

    1. Initial program 5.7

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied associate-*l/6.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.073388601361955291545855403151588574509 \cdot 10^{-267} \lor \neg \left(y \le 1.188637650407096621287004044639126749192 \cdot 10^{-194}\right):\\ \;\;\;\;\left(\frac{x}{z - y} - \frac{y}{z - y}\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \end{array}\]

Reproduce

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