Average Error: 6.5 → 6.5
Time: 7.5s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[x + \frac{y - x}{t} \cdot z\]
x + \frac{\left(y - x\right) \cdot z}{t}
x + \frac{y - x}{t} \cdot z
double f(double x, double y, double z, double t) {
        double r297143 = x;
        double r297144 = y;
        double r297145 = r297144 - r297143;
        double r297146 = z;
        double r297147 = r297145 * r297146;
        double r297148 = t;
        double r297149 = r297147 / r297148;
        double r297150 = r297143 + r297149;
        return r297150;
}

double f(double x, double y, double z, double t) {
        double r297151 = x;
        double r297152 = y;
        double r297153 = r297152 - r297151;
        double r297154 = t;
        double r297155 = r297153 / r297154;
        double r297156 = z;
        double r297157 = r297155 * r297156;
        double r297158 = r297151 + r297157;
        return r297158;
}

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
Target1.9
Herbie6.5
\[\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 3 regimes
  2. if (+ x (/ (* (- y x) z) t)) < -inf.0

    1. Initial program 64.0

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/0.2

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

    if -inf.0 < (+ x (/ (* (- y x) z) t)) < 1.45883816771774e+305

    1. Initial program 0.8

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

    if 1.45883816771774e+305 < (+ x (/ (* (- y x) z) t))

    1. Initial program 60.8

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

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

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y - x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.5

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

Reproduce

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