Average Error: 2.1 → 2.1
Time: 3.9s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\frac{t}{\frac{z - y}{x - y}}\]
\frac{x - y}{z - y} \cdot t
\frac{t}{\frac{z - y}{x - y}}
double f(double x, double y, double z, double t) {
        double r478585 = x;
        double r478586 = y;
        double r478587 = r478585 - r478586;
        double r478588 = z;
        double r478589 = r478588 - r478586;
        double r478590 = r478587 / r478589;
        double r478591 = t;
        double r478592 = r478590 * r478591;
        return r478592;
}

double f(double x, double y, double z, double t) {
        double r478593 = t;
        double r478594 = z;
        double r478595 = y;
        double r478596 = r478594 - r478595;
        double r478597 = x;
        double r478598 = r478597 - r478595;
        double r478599 = r478596 / r478598;
        double r478600 = r478593 / r478599;
        return r478600;
}

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

Derivation

  1. Initial program 2.1

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

    \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
  4. Using strategy rm
  5. Applied associate-*l/2.1

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

    \[\leadsto \frac{\color{blue}{t}}{\frac{z - y}{x - y}}\]
  7. Final simplification2.1

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

Reproduce

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