Average Error: 2.3 → 10.7
Time: 16.8s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\left(x - y\right) \cdot \frac{t}{z - y}\]
\frac{x - y}{z - y} \cdot t
\left(x - y\right) \cdot \frac{t}{z - y}
double f(double x, double y, double z, double t) {
        double r341767 = x;
        double r341768 = y;
        double r341769 = r341767 - r341768;
        double r341770 = z;
        double r341771 = r341770 - r341768;
        double r341772 = r341769 / r341771;
        double r341773 = t;
        double r341774 = r341772 * r341773;
        return r341774;
}

double f(double x, double y, double z, double t) {
        double r341775 = x;
        double r341776 = y;
        double r341777 = r341775 - r341776;
        double r341778 = t;
        double r341779 = z;
        double r341780 = r341779 - r341776;
        double r341781 = r341778 / r341780;
        double r341782 = r341777 * r341781;
        return r341782;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (- x y) (- z y)) < -3.9393291706671915e-183 or 1.715054494440415e-266 < (/ (- x y) (- z y)) < 1.4182513325054067e+187

    1. Initial program 0.9

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

    if -3.9393291706671915e-183 < (/ (- x y) (- z y)) < 1.715054494440415e-266 or 1.4182513325054067e+187 < (/ (- x y) (- z y))

    1. Initial program 11.7

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

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

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

      \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{t}{z - y}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification10.7

    \[\leadsto \left(x - y\right) \cdot \frac{t}{z - y}\]

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

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

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