Average Error: 2.1 → 2.2
Time: 12.8s
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 r8287040 = x;
        double r8287041 = y;
        double r8287042 = r8287040 - r8287041;
        double r8287043 = z;
        double r8287044 = r8287043 - r8287041;
        double r8287045 = r8287042 / r8287044;
        double r8287046 = t;
        double r8287047 = r8287045 * r8287046;
        return r8287047;
}

double f(double x, double y, double z, double t) {
        double r8287048 = t;
        double r8287049 = z;
        double r8287050 = y;
        double r8287051 = r8287049 - r8287050;
        double r8287052 = x;
        double r8287053 = r8287052 - r8287050;
        double r8287054 = r8287051 / r8287053;
        double r8287055 = r8287048 / r8287054;
        return r8287055;
}

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 2019156 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"

  :herbie-target
  (/ t (/ (- z y) (- x y)))

  (* (/ (- x y) (- z y)) t))