Average Error: 6.5 → 2.0
Time: 3.9s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le 8.72237655502040412 \cdot 10^{-83}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;z \le 2.11625050668119009 \cdot 10^{206}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;z \le 8.72237655502040412 \cdot 10^{-83}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{elif}\;z \le 2.11625050668119009 \cdot 10^{206}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r457818 = x;
        double r457819 = y;
        double r457820 = r457819 - r457818;
        double r457821 = z;
        double r457822 = r457820 * r457821;
        double r457823 = t;
        double r457824 = r457822 / r457823;
        double r457825 = r457818 + r457824;
        return r457825;
}

double f(double x, double y, double z, double t) {
        double r457826 = z;
        double r457827 = 8.722376555020404e-83;
        bool r457828 = r457826 <= r457827;
        double r457829 = x;
        double r457830 = y;
        double r457831 = r457830 - r457829;
        double r457832 = t;
        double r457833 = r457826 / r457832;
        double r457834 = r457831 * r457833;
        double r457835 = r457829 + r457834;
        double r457836 = 2.11625050668119e+206;
        bool r457837 = r457826 <= r457836;
        double r457838 = r457831 / r457832;
        double r457839 = r457838 * r457826;
        double r457840 = r457829 + r457839;
        double r457841 = r457832 / r457826;
        double r457842 = r457831 / r457841;
        double r457843 = r457829 + r457842;
        double r457844 = r457837 ? r457840 : r457843;
        double r457845 = r457828 ? r457835 : r457844;
        return r457845;
}

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
Target2.2
Herbie2.0
\[\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 3 regimes
  2. if z < 8.722376555020404e-83

    1. Initial program 5.0

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

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

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

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

    if 8.722376555020404e-83 < z < 2.11625050668119e+206

    1. Initial program 7.7

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

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

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

    if 2.11625050668119e+206 < z

    1. Initial program 25.3

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

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

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

Reproduce

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