Average Error: 7.1 → 1.0
Time: 5.6s
Precision: 64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} = -\infty \lor \neg \left(x + \frac{y \cdot \left(z - x\right)}{t} \le 3.9276215231926494 \cdot 10^{294}\right):\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\ \end{array}\]
x + \frac{y \cdot \left(z - x\right)}{t}
\begin{array}{l}
\mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} = -\infty \lor \neg \left(x + \frac{y \cdot \left(z - x\right)}{t} \le 3.9276215231926494 \cdot 10^{294}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r332909 = x;
        double r332910 = y;
        double r332911 = z;
        double r332912 = r332911 - r332909;
        double r332913 = r332910 * r332912;
        double r332914 = t;
        double r332915 = r332913 / r332914;
        double r332916 = r332909 + r332915;
        return r332916;
}

double f(double x, double y, double z, double t) {
        double r332917 = x;
        double r332918 = y;
        double r332919 = z;
        double r332920 = r332919 - r332917;
        double r332921 = r332918 * r332920;
        double r332922 = t;
        double r332923 = r332921 / r332922;
        double r332924 = r332917 + r332923;
        double r332925 = -inf.0;
        bool r332926 = r332924 <= r332925;
        double r332927 = 3.9276215231926494e+294;
        bool r332928 = r332924 <= r332927;
        double r332929 = !r332928;
        bool r332930 = r332926 || r332929;
        double r332931 = r332920 / r332922;
        double r332932 = r332918 * r332931;
        double r332933 = r332917 + r332932;
        double r332934 = r332930 ? r332933 : r332924;
        return r332934;
}

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

Original7.1
Target2.0
Herbie1.0
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ (* y (- z x)) t)) < -inf.0 or 3.9276215231926494e+294 < (+ x (/ (* y (- z x)) t))

    1. Initial program 57.0

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

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

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

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

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

    1. Initial program 0.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - x\right)}{t} = -\infty \lor \neg \left(x + \frac{y \cdot \left(z - x\right)}{t} \le 3.9276215231926494 \cdot 10^{294}\right):\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2020034 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

  :herbie-target
  (- x (+ (* x (/ y t)) (* (- z) (/ y t))))

  (+ x (/ (* y (- z x)) t)))