Average Error: 2.1 → 2.2
Time: 11.3s
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 r341837 = x;
        double r341838 = y;
        double r341839 = r341837 - r341838;
        double r341840 = z;
        double r341841 = r341840 - r341838;
        double r341842 = r341839 / r341841;
        double r341843 = t;
        double r341844 = r341842 * r341843;
        return r341844;
}

double f(double x, double y, double z, double t) {
        double r341845 = t;
        double r341846 = z;
        double r341847 = y;
        double r341848 = r341846 - r341847;
        double r341849 = x;
        double r341850 = r341849 - r341847;
        double r341851 = r341848 / r341850;
        double r341852 = r341845 / r341851;
        return r341852;
}

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.2
Herbie2.2
\[\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.2

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

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

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

Reproduce

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