Average Error: 2.4 → 2.3
Time: 24.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 r368017 = x;
        double r368018 = y;
        double r368019 = r368017 - r368018;
        double r368020 = z;
        double r368021 = r368020 - r368018;
        double r368022 = r368019 / r368021;
        double r368023 = t;
        double r368024 = r368022 * r368023;
        return r368024;
}

double f(double x, double y, double z, double t) {
        double r368025 = t;
        double r368026 = z;
        double r368027 = y;
        double r368028 = r368026 - r368027;
        double r368029 = x;
        double r368030 = r368029 - r368027;
        double r368031 = r368028 / r368030;
        double r368032 = r368025 / r368031;
        return r368032;
}

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

Derivation

  1. Initial program 2.4

    \[\frac{x - y}{z - y} \cdot t\]
  2. Using strategy rm
  3. Applied div-inv2.5

    \[\leadsto \color{blue}{\left(\left(x - y\right) \cdot \frac{1}{z - y}\right)} \cdot t\]
  4. Applied associate-*l*10.8

    \[\leadsto \color{blue}{\left(x - y\right) \cdot \left(\frac{1}{z - y} \cdot t\right)}\]
  5. Simplified10.7

    \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}}\]
  6. Using strategy rm
  7. Applied associate-*r/11.7

    \[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot t}{z - y}}\]
  8. Simplified11.7

    \[\leadsto \frac{\color{blue}{t \cdot \left(x - y\right)}}{z - y}\]
  9. Using strategy rm
  10. Applied associate-/l*2.3

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

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

Reproduce

herbie shell --seed 2019199 +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))