Average Error: 6.5 → 2.0
Time: 3.1s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[x + \frac{1}{\frac{\frac{t}{z}}{y - x}}\]
x + \frac{\left(y - x\right) \cdot z}{t}
x + \frac{1}{\frac{\frac{t}{z}}{y - x}}
double f(double x, double y, double z, double t) {
        double r401173 = x;
        double r401174 = y;
        double r401175 = r401174 - r401173;
        double r401176 = z;
        double r401177 = r401175 * r401176;
        double r401178 = t;
        double r401179 = r401177 / r401178;
        double r401180 = r401173 + r401179;
        return r401180;
}

double f(double x, double y, double z, double t) {
        double r401181 = x;
        double r401182 = 1.0;
        double r401183 = t;
        double r401184 = z;
        double r401185 = r401183 / r401184;
        double r401186 = y;
        double r401187 = r401186 - r401181;
        double r401188 = r401185 / r401187;
        double r401189 = r401182 / r401188;
        double r401190 = r401181 + r401189;
        return r401190;
}

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
Herbie2.0
\[\begin{array}{l} \mathbf{if}\;x \lt -9.0255111955330046 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.2750321637007147 \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-num2.0

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y - x}}}\]
  6. Final simplification2.0

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

Reproduce

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

  :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)))