Average Error: 6.6 → 2.2
Time: 11.6s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;\frac{z}{\frac{t}{y - x}} + 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{z}{\frac{t}{y - x}} + 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 r543945 = x;
        double r543946 = y;
        double r543947 = r543946 - r543945;
        double r543948 = z;
        double r543949 = r543947 * r543948;
        double r543950 = t;
        double r543951 = r543949 / r543950;
        double r543952 = r543945 + r543951;
        return r543952;
}

double f(double x, double y, double z, double t) {
        double r543953 = z;
        double r543954 = -4.0164937919145246e-92;
        bool r543955 = r543953 <= r543954;
        double r543956 = t;
        double r543957 = y;
        double r543958 = x;
        double r543959 = r543957 - r543958;
        double r543960 = r543956 / r543959;
        double r543961 = r543953 / r543960;
        double r543962 = r543961 + r543958;
        double r543963 = r543953 / r543956;
        double r543964 = r543959 * r543963;
        double r543965 = r543958 + r543964;
        double r543966 = r543955 ? r543962 : r543965;
        return r543966;
}

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 *-un-lft-identity10.3

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

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

      \[\leadsto x + \color{blue}{\left(y - x\right)} \cdot \frac{z}{t}\]
    6. Using strategy rm
    7. Applied pow12.6

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{{\left(\frac{z}{t}\right)}^{1}}\]
    8. Applied pow12.6

      \[\leadsto x + \color{blue}{{\left(y - x\right)}^{1}} \cdot {\left(\frac{z}{t}\right)}^{1}\]
    9. Applied pow-prod-down2.6

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

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

    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{z}{\frac{t}{y - x}} + 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)))