Average Error: 6.6 → 2.2
Time: 19.2s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \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}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1218182 = x;
        double r1218183 = y;
        double r1218184 = r1218183 - r1218182;
        double r1218185 = z;
        double r1218186 = r1218184 * r1218185;
        double r1218187 = t;
        double r1218188 = r1218186 / r1218187;
        double r1218189 = r1218182 + r1218188;
        return r1218189;
}

double f(double x, double y, double z, double t) {
        double r1218190 = z;
        double r1218191 = -4.0164937919145246e-92;
        bool r1218192 = r1218190 <= r1218191;
        double r1218193 = x;
        double r1218194 = y;
        double r1218195 = r1218194 - r1218193;
        double r1218196 = t;
        double r1218197 = r1218195 / r1218196;
        double r1218198 = r1218197 * r1218190;
        double r1218199 = r1218193 + r1218198;
        double r1218200 = r1218190 / r1218196;
        double r1218201 = r1218195 * r1218200;
        double r1218202 = r1218193 + r1218201;
        double r1218203 = r1218192 ? r1218199 : r1218202;
        return r1218203;
}

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 clear-num2.5

      \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{t}{z}}{y - x}}}\]
    6. Taylor expanded around 0 10.3

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

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

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