Average Error: 2.4 → 3.0
Time: 4.8s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -5901250107637.39355:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -5901250107637.39355:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\

\mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\

\mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r504685 = x;
        double r504686 = y;
        double r504687 = r504685 - r504686;
        double r504688 = z;
        double r504689 = r504688 - r504686;
        double r504690 = r504687 / r504689;
        double r504691 = t;
        double r504692 = r504690 * r504691;
        return r504692;
}

double f(double x, double y, double z, double t) {
        double r504693 = t;
        double r504694 = -5901250107637.394;
        bool r504695 = r504693 <= r504694;
        double r504696 = x;
        double r504697 = y;
        double r504698 = r504696 - r504697;
        double r504699 = z;
        double r504700 = r504699 - r504697;
        double r504701 = r504693 / r504700;
        double r504702 = r504698 * r504701;
        double r504703 = 1.0;
        double r504704 = r504702 / r504703;
        double r504705 = -5.601256576676233e-260;
        bool r504706 = r504693 <= r504705;
        double r504707 = r504698 * r504693;
        double r504708 = r504707 / r504700;
        double r504709 = 2.922609914751092e-116;
        bool r504710 = r504693 <= r504709;
        double r504711 = r504698 / r504700;
        double r504712 = r504711 * r504693;
        double r504713 = r504710 ? r504712 : r504704;
        double r504714 = r504706 ? r504708 : r504713;
        double r504715 = r504695 ? r504704 : r504714;
        return r504715;
}

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

Derivation

  1. Split input into 3 regimes
  2. if t < -5901250107637.394 or 2.922609914751092e-116 < t

    1. Initial program 2.2

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

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

      \[\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-frac3.3

      \[\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*3.1

      \[\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 associate-*l/3.1

      \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \left(\frac{\sqrt[3]{x - y}}{z - y} \cdot t\right)}{1}}\]
    9. Simplified3.7

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

    if -5901250107637.394 < t < -5.601256576676233e-260

    1. Initial program 2.3

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

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

    if -5.601256576676233e-260 < t < 2.922609914751092e-116

    1. Initial program 2.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5901250107637.39355:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\ \;\;\;\;\frac{x - y}{z - y} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\ \end{array}\]

Reproduce

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