Average Error: 2.3 → 1.5
Time: 6.5s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t = -\infty:\\ \;\;\;\;1 \cdot \left(\left(x - y\right) \cdot \frac{t}{z - y}\right)\\ \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} \cdot t = -\infty:\\
\;\;\;\;1 \cdot \left(\left(x - y\right) \cdot \frac{t}{z - y}\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r528459 = x;
        double r528460 = y;
        double r528461 = r528459 - r528460;
        double r528462 = z;
        double r528463 = r528462 - r528460;
        double r528464 = r528461 / r528463;
        double r528465 = t;
        double r528466 = r528464 * r528465;
        return r528466;
}

double f(double x, double y, double z, double t) {
        double r528467 = x;
        double r528468 = y;
        double r528469 = r528467 - r528468;
        double r528470 = z;
        double r528471 = r528470 - r528468;
        double r528472 = r528469 / r528471;
        double r528473 = t;
        double r528474 = r528472 * r528473;
        double r528475 = -inf.0;
        bool r528476 = r528474 <= r528475;
        double r528477 = 1.0;
        double r528478 = r528473 / r528471;
        double r528479 = r528469 * r528478;
        double r528480 = r528477 * r528479;
        double r528481 = r528476 ? r528480 : r528474;
        return r528481;
}

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.3
Target2.2
Herbie1.5
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 2 regimes
  2. if (* (/ (- x y) (- z y)) t) < -inf.0

    1. Initial program 64.0

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity64.0

      \[\leadsto \frac{x - y}{\color{blue}{1 \cdot \left(z - y\right)}} \cdot t\]
    4. Applied add-cube-cbrt64.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \sqrt[3]{x - y}}}{1 \cdot \left(z - y\right)} \cdot t\]
    5. Applied times-frac64.0

      \[\leadsto \color{blue}{\left(\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \frac{\sqrt[3]{x - y}}{z - y}\right)} \cdot t\]
    6. Applied associate-*l*4.0

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity4.0

      \[\leadsto \color{blue}{\left(1 \cdot \frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1}\right)} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)\]
    9. Applied associate-*l*4.0

      \[\leadsto \color{blue}{1 \cdot \left(\frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{1} \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)\right)}\]
    10. Simplified0.2

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

    if -inf.0 < (* (/ (- x y) (- z y)) t)

    1. Initial program 1.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \cdot t = -\infty:\\ \;\;\;\;1 \cdot \left(\left(x - y\right) \cdot \frac{t}{z - y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \end{array}\]

Reproduce

herbie shell --seed 2019356 +o rules:numerics
(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))