Average Error: 2.2 → 2.1
Time: 15.2s
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 r340504 = x;
        double r340505 = y;
        double r340506 = r340504 - r340505;
        double r340507 = z;
        double r340508 = r340507 - r340505;
        double r340509 = r340506 / r340508;
        double r340510 = t;
        double r340511 = r340509 * r340510;
        return r340511;
}

double f(double x, double y, double z, double t) {
        double r340512 = t;
        double r340513 = z;
        double r340514 = y;
        double r340515 = r340513 - r340514;
        double r340516 = x;
        double r340517 = r340516 - r340514;
        double r340518 = r340515 / r340517;
        double r340519 = r340512 / r340518;
        return r340519;
}

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

Derivation

  1. Initial program 2.2

    \[\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 2019196 +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))