Average Error: 6.6 → 2.1
Time: 11.7s
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 r953122 = x;
        double r953123 = y;
        double r953124 = r953123 - r953122;
        double r953125 = z;
        double r953126 = r953124 * r953125;
        double r953127 = t;
        double r953128 = r953126 / r953127;
        double r953129 = r953122 + r953128;
        return r953129;
}

double f(double x, double y, double z, double t) {
        double r953130 = x;
        double r953131 = 1.0;
        double r953132 = t;
        double r953133 = z;
        double r953134 = r953132 / r953133;
        double r953135 = y;
        double r953136 = r953135 - r953130;
        double r953137 = r953134 / r953136;
        double r953138 = r953131 / r953137;
        double r953139 = r953130 + r953138;
        return r953139;
}

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.6
Target2.1
Herbie2.1
\[\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.6

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

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

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

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

Reproduce

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