Average Error: 6.5 → 1.9
Time: 26.7s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[x + \frac{1}{\frac{1}{\frac{y - x}{\frac{t}{z}}}}\]
x + \frac{\left(y - x\right) \cdot z}{t}
x + \frac{1}{\frac{1}{\frac{y - x}{\frac{t}{z}}}}
double f(double x, double y, double z, double t) {
        double r19735944 = x;
        double r19735945 = y;
        double r19735946 = r19735945 - r19735944;
        double r19735947 = z;
        double r19735948 = r19735946 * r19735947;
        double r19735949 = t;
        double r19735950 = r19735948 / r19735949;
        double r19735951 = r19735944 + r19735950;
        return r19735951;
}

double f(double x, double y, double z, double t) {
        double r19735952 = x;
        double r19735953 = 1.0;
        double r19735954 = y;
        double r19735955 = r19735954 - r19735952;
        double r19735956 = t;
        double r19735957 = z;
        double r19735958 = r19735956 / r19735957;
        double r19735959 = r19735955 / r19735958;
        double r19735960 = r19735953 / r19735959;
        double r19735961 = r19735953 / r19735960;
        double r19735962 = r19735952 + r19735961;
        return r19735962;
}

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

Original6.5
Target2.1
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;x \lt -9.025511195533004570453352523209034680317 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.275032163700714748507147332551979944314 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Initial program 6.5

    \[x + \frac{\left(y - x\right) \cdot z}{t}\]
  2. Using strategy rm
  3. Applied associate-/l*1.9

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
  4. Using strategy rm
  5. Applied clear-num1.9

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y - x}}}\]
  6. Using strategy rm
  7. Applied clear-num1.9

    \[\leadsto x + \frac{1}{\color{blue}{\frac{1}{\frac{y - x}{\frac{t}{z}}}}}\]
  8. Final simplification1.9

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

Reproduce

herbie shell --seed 2019169 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"

  :herbie-target
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

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