Average Error: 2.1 → 2.2
Time: 20.4s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[t \cdot \frac{\frac{1}{z - y}}{\frac{1}{x - y}}\]
\frac{x - y}{z - y} \cdot t
t \cdot \frac{\frac{1}{z - y}}{\frac{1}{x - y}}
double f(double x, double y, double z, double t) {
        double r31838794 = x;
        double r31838795 = y;
        double r31838796 = r31838794 - r31838795;
        double r31838797 = z;
        double r31838798 = r31838797 - r31838795;
        double r31838799 = r31838796 / r31838798;
        double r31838800 = t;
        double r31838801 = r31838799 * r31838800;
        return r31838801;
}

double f(double x, double y, double z, double t) {
        double r31838802 = t;
        double r31838803 = 1.0;
        double r31838804 = z;
        double r31838805 = y;
        double r31838806 = r31838804 - r31838805;
        double r31838807 = r31838803 / r31838806;
        double r31838808 = x;
        double r31838809 = r31838808 - r31838805;
        double r31838810 = r31838803 / r31838809;
        double r31838811 = r31838807 / r31838810;
        double r31838812 = r31838802 * r31838811;
        return r31838812;
}

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.0
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.2

    \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x - y}}} \cdot t\]
  4. Using strategy rm
  5. Applied div-inv2.3

    \[\leadsto \frac{1}{\color{blue}{\left(z - y\right) \cdot \frac{1}{x - y}}} \cdot t\]
  6. Applied associate-/r*2.2

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

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

Reproduce

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