Average Error: 2.1 → 2.2
Time: 13.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 r7478444 = x;
        double r7478445 = y;
        double r7478446 = r7478444 - r7478445;
        double r7478447 = z;
        double r7478448 = r7478447 - r7478445;
        double r7478449 = r7478446 / r7478448;
        double r7478450 = t;
        double r7478451 = r7478449 * r7478450;
        return r7478451;
}

double f(double x, double y, double z, double t) {
        double r7478452 = t;
        double r7478453 = z;
        double r7478454 = y;
        double r7478455 = r7478453 - r7478454;
        double r7478456 = x;
        double r7478457 = r7478456 - r7478454;
        double r7478458 = r7478455 / r7478457;
        double r7478459 = r7478452 / r7478458;
        return r7478459;
}

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 +o rules:numerics
(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))