Average Error: 2.2 → 11.6
Time: 14.1s
Precision: 64
\[\frac{x - y}{z - y} \cdot t\]
\[\frac{\left(x - y\right) \cdot t}{z - y}\]
\frac{x - y}{z - y} \cdot t
\frac{\left(x - y\right) \cdot t}{z - y}
double f(double x, double y, double z, double t) {
        double r403637 = x;
        double r403638 = y;
        double r403639 = r403637 - r403638;
        double r403640 = z;
        double r403641 = r403640 - r403638;
        double r403642 = r403639 / r403641;
        double r403643 = t;
        double r403644 = r403642 * r403643;
        return r403644;
}

double f(double x, double y, double z, double t) {
        double r403645 = x;
        double r403646 = y;
        double r403647 = r403645 - r403646;
        double r403648 = t;
        double r403649 = r403647 * r403648;
        double r403650 = z;
        double r403651 = r403650 - r403646;
        double r403652 = r403649 / r403651;
        return r403652;
}

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
Herbie11.6
\[\frac{t}{\frac{z - y}{x - y}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (- x y) (- z y)) < -5.880482871569711e-224 or 1.3831278407051872e-84 < (/ (- x y) (- z y)) < 6.356940358110683e+158

    1. Initial program 0.8

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

    if -5.880482871569711e-224 < (/ (- x y) (- z y)) < 1.3831278407051872e-84

    1. Initial program 5.6

      \[\frac{x - y}{z - y} \cdot t\]
    2. Using strategy rm
    3. Applied associate-*l/2.3

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

    if 6.356940358110683e+158 < (/ (- x y) (- z y))

    1. Initial program 14.2

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

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

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

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

Reproduce

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