Average Error: 2.3 → 2.3
Time: 4.5s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le 8.74690451588153372 \cdot 10^{-269}:\\ \;\;\;\;{\left(t \cdot \frac{x - y}{z - y}\right)}^{1}\\ \mathbf{elif}\;t \le 3.5231411634558426 \cdot 10^{-34}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]
\frac{x - y}{z - y} \cdot t
\begin{array}{l}
\mathbf{if}\;t \le 8.74690451588153372 \cdot 10^{-269}:\\
\;\;\;\;{\left(t \cdot \frac{x - y}{z - y}\right)}^{1}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r492046 = x;
        double r492047 = y;
        double r492048 = r492046 - r492047;
        double r492049 = z;
        double r492050 = r492049 - r492047;
        double r492051 = r492048 / r492050;
        double r492052 = t;
        double r492053 = r492051 * r492052;
        return r492053;
}

double f(double x, double y, double z, double t) {
        double r492054 = t;
        double r492055 = 8.746904515881534e-269;
        bool r492056 = r492054 <= r492055;
        double r492057 = x;
        double r492058 = y;
        double r492059 = r492057 - r492058;
        double r492060 = z;
        double r492061 = r492060 - r492058;
        double r492062 = r492059 / r492061;
        double r492063 = r492054 * r492062;
        double r492064 = 1.0;
        double r492065 = pow(r492063, r492064);
        double r492066 = 3.5231411634558426e-34;
        bool r492067 = r492054 <= r492066;
        double r492068 = r492059 * r492054;
        double r492069 = r492068 / r492061;
        double r492070 = r492054 / r492061;
        double r492071 = r492059 * r492070;
        double r492072 = r492067 ? r492069 : r492071;
        double r492073 = r492056 ? r492065 : r492072;
        return r492073;
}

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

Derivation

  1. Split input into 3 regimes
  2. if t < 8.746904515881534e-269

    1. Initial program 2.6

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \frac{x - y}{z - y}\right)} \cdot \sqrt[3]{t}\]
    8. Using strategy rm
    9. Applied associate-*l*3.7

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

      \[\leadsto \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \color{blue}{\left(\sqrt[3]{t} \cdot \frac{x - y}{z - y}\right)}\]
    11. Using strategy rm
    12. Applied pow13.7

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \left(\sqrt[3]{t} \cdot \frac{x - y}{z - y}\right)\right)}^{1}}\]
    19. Simplified2.6

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

    if 8.746904515881534e-269 < t < 3.5231411634558426e-34

    1. Initial program 1.8

      \[\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 3.5231411634558426e-34 < t

    1. Initial program 1.9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le 8.74690451588153372 \cdot 10^{-269}:\\ \;\;\;\;{\left(t \cdot \frac{x - y}{z - y}\right)}^{1}\\ \mathbf{elif}\;t \le 3.5231411634558426 \cdot 10^{-34}:\\ \;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \end{array}\]

Reproduce

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