Average Error: 6.1 → 2.0
Time: 13.0s
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 r323169 = x;
        double r323170 = y;
        double r323171 = r323170 - r323169;
        double r323172 = z;
        double r323173 = r323171 * r323172;
        double r323174 = t;
        double r323175 = r323173 / r323174;
        double r323176 = r323169 + r323175;
        return r323176;
}

double f(double x, double y, double z, double t) {
        double r323177 = x;
        double r323178 = 1.0;
        double r323179 = t;
        double r323180 = z;
        double r323181 = r323179 / r323180;
        double r323182 = y;
        double r323183 = r323182 - r323177;
        double r323184 = r323181 / r323183;
        double r323185 = r323178 / r323184;
        double r323186 = r323177 + r323185;
        return r323186;
}

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.9
Herbie2.0
\[\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.1

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

    \[\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 2019212 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

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

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