Average Error: 2.3 → 2.4
Time: 5.4s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;y \le -9.3910125961314414 \cdot 10^{-161} \lor \neg \left(y \le 6.0401320354982989 \cdot 10^{-75}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(x - y\right) \cdot \frac{t}{z - y}\right)}^{1}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -9.3910125961314414 \cdot 10^{-161} \lor \neg \left(y \le 6.0401320354982989 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r426750 = x;
        double r426751 = y;
        double r426752 = r426750 - r426751;
        double r426753 = z;
        double r426754 = r426753 - r426751;
        double r426755 = r426752 / r426754;
        double r426756 = t;
        double r426757 = r426755 * r426756;
        return r426757;
}

double f(double x, double y, double z, double t) {
        double r426758 = y;
        double r426759 = -9.391012596131441e-161;
        bool r426760 = r426758 <= r426759;
        double r426761 = 6.040132035498299e-75;
        bool r426762 = r426758 <= r426761;
        double r426763 = !r426762;
        bool r426764 = r426760 || r426763;
        double r426765 = x;
        double r426766 = r426765 - r426758;
        double r426767 = z;
        double r426768 = r426767 - r426758;
        double r426769 = r426766 / r426768;
        double r426770 = t;
        double r426771 = r426769 * r426770;
        double r426772 = r426770 / r426768;
        double r426773 = r426766 * r426772;
        double r426774 = 1.0;
        double r426775 = pow(r426773, r426774);
        double r426776 = r426764 ? r426771 : r426775;
        return r426776;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -9.391012596131441e-161 or 6.040132035498299e-75 < y

    1. Initial program 1.0

      \[\frac{x - y}{z - y} \cdot t\]

    if -9.391012596131441e-161 < y < 6.040132035498299e-75

    1. Initial program 5.7

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied clear-num6.1

      \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
    4. Using strategy rm
    5. Applied pow16.1

      \[\leadsto \frac{1}{\frac{z - y}{x - y}} \cdot \color{blue}{{t}^{1}}\]
    6. Applied pow16.1

      \[\leadsto \color{blue}{{\left(\frac{1}{\frac{z - y}{x - y}}\right)}^{1}} \cdot {t}^{1}\]
    7. Applied pow-prod-down6.1

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

      \[\leadsto {\color{blue}{\left(\frac{t}{\frac{z - y}{x - y}}\right)}}^{1}\]
    9. Using strategy rm
    10. Applied div-sub5.7

      \[\leadsto {\left(\frac{t}{\color{blue}{\frac{z}{x - y} - \frac{y}{x - y}}}\right)}^{1}\]
    11. Using strategy rm
    12. Applied div-inv5.7

      \[\leadsto {\left(\frac{t}{\frac{z}{x - y} - \color{blue}{y \cdot \frac{1}{x - y}}}\right)}^{1}\]
    13. Applied div-inv5.7

      \[\leadsto {\left(\frac{t}{\color{blue}{z \cdot \frac{1}{x - y}} - y \cdot \frac{1}{x - y}}\right)}^{1}\]
    14. Applied distribute-rgt-out--5.7

      \[\leadsto {\left(\frac{t}{\color{blue}{\frac{1}{x - y} \cdot \left(z - y\right)}}\right)}^{1}\]
    15. Applied *-un-lft-identity5.7

      \[\leadsto {\left(\frac{\color{blue}{1 \cdot t}}{\frac{1}{x - y} \cdot \left(z - y\right)}\right)}^{1}\]
    16. Applied times-frac6.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -9.3910125961314414 \cdot 10^{-161} \lor \neg \left(y \le 6.0401320354982989 \cdot 10^{-75}\right):\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(x - y\right) \cdot \frac{t}{z - y}\right)}^{1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020056 +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))