Average Error: 6.4 → 6.4
Time: 10.4s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
x + \frac{\left(y - x\right) \cdot z}{t}
x + \frac{\left(y - x\right) \cdot z}{t}
double f(double x, double y, double z, double t) {
        double r384379 = x;
        double r384380 = y;
        double r384381 = r384380 - r384379;
        double r384382 = z;
        double r384383 = r384381 * r384382;
        double r384384 = t;
        double r384385 = r384383 / r384384;
        double r384386 = r384379 + r384385;
        return r384386;
}

double f(double x, double y, double z, double t) {
        double r384387 = x;
        double r384388 = y;
        double r384389 = r384388 - r384387;
        double r384390 = z;
        double r384391 = r384389 * r384390;
        double r384392 = t;
        double r384393 = r384391 / r384392;
        double r384394 = r384387 + r384393;
        return r384394;
}

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.4
Target2.1
Herbie6.4
\[\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. Split input into 2 regimes
  2. if (+ x (/ (* (- y x) z) t)) < -1.931901752184042e+284 or 1.2079056784186795e+284 < (+ x (/ (* (- y x) z) t))

    1. Initial program 42.8

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

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

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

    if -1.931901752184042e+284 < (+ x (/ (* (- y x) z) t)) < 1.2079056784186795e+284

    1. Initial program 0.8

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.4

    \[\leadsto x + \frac{\left(y - x\right) \cdot z}{t}\]

Reproduce

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