Average Error: 6.6 → 2.2
Time: 14.4s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;\frac{y - x}{t} \cdot z + x\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\
\;\;\;\;\frac{y - x}{t} \cdot z + x\\

\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r623402 = x;
        double r623403 = y;
        double r623404 = r623403 - r623402;
        double r623405 = z;
        double r623406 = r623404 * r623405;
        double r623407 = t;
        double r623408 = r623406 / r623407;
        double r623409 = r623402 + r623408;
        return r623409;
}

double f(double x, double y, double z, double t) {
        double r623410 = z;
        double r623411 = -4.0164937919145246e-92;
        bool r623412 = r623410 <= r623411;
        double r623413 = y;
        double r623414 = x;
        double r623415 = r623413 - r623414;
        double r623416 = t;
        double r623417 = r623415 / r623416;
        double r623418 = r623417 * r623410;
        double r623419 = r623418 + r623414;
        double r623420 = r623410 / r623416;
        double r623421 = r623415 * r623420;
        double r623422 = r623414 + r623421;
        double r623423 = r623412 ? r623419 : r623422;
        return r623423;
}

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.2
Herbie2.2
\[\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. Split input into 2 regimes
  2. if z < -4.0164937919145246e-92

    1. Initial program 10.3

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity2.4

      \[\leadsto x + \frac{y - x}{\frac{t}{\color{blue}{1 \cdot z}}}\]
    6. Applied *-un-lft-identity2.4

      \[\leadsto x + \frac{y - x}{\frac{\color{blue}{1 \cdot t}}{1 \cdot z}}\]
    7. Applied times-frac2.4

      \[\leadsto x + \frac{y - x}{\color{blue}{\frac{1}{1} \cdot \frac{t}{z}}}\]
    8. Applied *-un-lft-identity2.4

      \[\leadsto x + \frac{\color{blue}{1 \cdot \left(y - x\right)}}{\frac{1}{1} \cdot \frac{t}{z}}\]
    9. Applied times-frac2.4

      \[\leadsto x + \color{blue}{\frac{1}{\frac{1}{1}} \cdot \frac{y - x}{\frac{t}{z}}}\]
    10. Simplified2.4

      \[\leadsto x + \color{blue}{1} \cdot \frac{y - x}{\frac{t}{z}}\]
    11. Simplified2.9

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

    if -4.0164937919145246e-92 < z

    1. Initial program 5.2

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.2

      \[\leadsto x + \frac{\left(y - x\right) \cdot z}{\color{blue}{1 \cdot t}}\]
    4. Applied times-frac2.0

      \[\leadsto x + \color{blue}{\frac{y - x}{1} \cdot \frac{z}{t}}\]
    5. Simplified2.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;\frac{y - x}{t} \cdot z + x\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]

Reproduce

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