Average Error: 6.1 → 1.8
Time: 15.2s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[x + \frac{y - x}{\frac{t}{z}}\]
x + \frac{\left(y - x\right) \cdot z}{t}
x + \frac{y - x}{\frac{t}{z}}
double f(double x, double y, double z, double t) {
        double r26356321 = x;
        double r26356322 = y;
        double r26356323 = r26356322 - r26356321;
        double r26356324 = z;
        double r26356325 = r26356323 * r26356324;
        double r26356326 = t;
        double r26356327 = r26356325 / r26356326;
        double r26356328 = r26356321 + r26356327;
        return r26356328;
}

double f(double x, double y, double z, double t) {
        double r26356329 = x;
        double r26356330 = y;
        double r26356331 = r26356330 - r26356329;
        double r26356332 = t;
        double r26356333 = z;
        double r26356334 = r26356332 / r26356333;
        double r26356335 = r26356331 / r26356334;
        double r26356336 = r26356329 + r26356335;
        return r26356336;
}

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.1
Target1.7
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;x \lt -9.025511195533005 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.275032163700715 \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.1

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

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

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

Reproduce

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